CentOS Command Line: Umarni gama gari da cikakkun bayanai

Fayiloli da Gudanarwa

  1. ls: Lissafin fayiloli da kundayen adireshi a cikin kundin adireshi na yanzu. Yana nuna sunayen fayiloli da kundayen adireshi da ke cikin kundin adireshi na yanzu.

    Misali: ls

  2. pwd: Buga cikakken hanyar kundin adireshi na yanzu. Yana taimaka muku sanin inda kuke a cikin tsarin fayil.

    Misali: pwd

  3. cd <directory>: Canja zuwa ƙayyadadden kundin adireshi. Ta amfani da wannan umarni, zaku iya kewaya tsakanin kundayen adireshi a cikin tsarin fayil ɗin ku.

    Misali: cd /home/user/documents

  4. touch <filename>: Ƙirƙiri sabon fayil ko sabunta lokacin gyara fayil ɗin da ke akwai. Idan fayil ɗin ya riga ya wanzu, zai sabunta lokacin gyarawa.

    Misali: touch newfile.txt

  5. cp <source> <destination>: Kwafi fayil ko kundin adireshi daga wurin tushe zuwa wurin da aka nufa. Kuna iya kwafin fayiloli ko kundayen adireshi da yawa ta hanyar tantance tushe da yawa.

    Misali:

    • cp file.txt /home/user/documents/(kwafi fayil)
    • cp -r folder1 /home/user/documents/(kwafi directory)
  6. mv <source> <destination>: Matsar ko sake suna fayil ko directory daga wurin tushe zuwa wurin da aka nufa. Idan wurin sabon suna ne, zai sake suna; idan sabuwar hanya ce, za ta motsa.

    Misali:

    • mv file.txt /home/user/documents/file_new.txt(sake suna fayil)
    • mv folder1 /home/user/documents/(matsar da directory)
  7. rm <file>: Cire fayil. Lura cewa wannan umarni zai share fayil ɗin ba tare da wani tabbaci ba, don haka yi amfani da shi a hankali.

    Misali: rm file.txt

  8. mkdir <directory>: Ƙirƙiri sabon kundin adireshi tare da ƙayyadadden suna.

    Misali: mkdir new_folder

  9. rmdir <directory>: Cire kundin shugabanci mara komai. Lura cewa kawai za ku iya cire kundin adireshi mara komai ta amfani da wannan umarni.

    Misali: rmdir empty_folder

Gudanar da Izinin Fayil da Darakta

  1. chmod <permissions> <file/directory>: Canja izinin shiga fayil ko kundin adireshi bisa ga takamaiman izini. Izinin gama gari sun haɗa da "r"(karanta), "w"(rubuta), da "x"(aiwatarwa).

    Misali: chmod u+rwx file.txt(ƙara karantawa, rubuta, aiwatar da izini ga mai shi)

  2. chown <user>:<group> <file/directory>: Canja mai fayil ko kundin adireshi zuwa takamaiman mai amfani da rukuni.

    Misali: chown user1:group1 file.txt(saita mai shi da rukuni don file.txt)

Tsari da Gudanar da Sabis

  1. ps: Lissafin tafiyar matakai. Wannan umarnin yana nuna jerin matakai da kuma ID ɗin Tsari masu dacewa(PID).

    Misali: ps

  2. top: Nuna tafiyar matakai da albarkatun tsarin. Wannan umarnin yana ba da hanyar haɗin gwiwa don duba ayyukan tafiyarwa da saka idanu albarkatun tsarin kamar CPU, RAM.

    Misali: top

  3. kill <PID>: Kashe tsarin tare da ƙayyadadden ID na tsari(PID). Wannan umarnin yana aika sigina don dakatar da aikin, yana ba shi damar fita ko rufewa.

    Misali: kill 1234(kashe aikin tare da PID 1234)

  4. systemctl start <service>: Fara takamaiman sabis. Sabis shiri ne da ke gudana a bayan tsarin, kuma wannan umarni yana farawa da shi.

    Misali: systemctl start httpd(fara sabis na Apache)

  5. systemctl stop <service>: Dakatar da takamaiman sabis. Wannan umarnin yana dakatar da sabis ɗin da ke gudana.

    Misali: systemctl stop httpd(dakatar da sabis na Apache)

  6. systemctl restart <service>: Sake kunna takamaiman sabis ɗin. Wannan umarnin yana tsayawa kuma yana farawa sabis.

    Misali: systemctl restart httpd(sake kunna sabis na Apache)

  7. systemctl status <service>: Nuna matsayin takamaiman sabis ɗin. Wannan umarni yana nuna ko sabis ɗin yana gudana ko a'a, da matsayinsa.

    Misali: systemctl status httpd(nuna matsayin sabis na Apache)

Gudanar da Kunshin

  1. yum install <package>: Shigar da kunshin software daga CentOS ma'ajiyar.

    Misali: yum install nginx(shigar da Nginx)

  2. yum update <package>: Sabunta kunshin software da aka shigar zuwa sabon sigar.

    Misali: yum update nginx(sabuntawa Nginx)

  3. yum remove <package>: Cire kunshin da aka shigar daga tsarin.

    Misali: yum remove nginx(cire Nginx)

Gudanar da hanyar sadarwa

  1. ifconfig: Nuna bayanai game da na'urorin cibiyar sadarwa da adiresoshin IP na tsarin.

    Misali: ifconfig

  2. ip addr: Nuna bayanai game da na'urorin cibiyar sadarwa da adiresoshin IP na tsarin. Wannan umarni yayi kama da ifconfig.

    Misali: ip addr

  3. ping <hostname/IP>: Bincika haɗin yanar gizo zuwa ƙayyadadden adireshin IP ko sunan yanki ta hanyar aika fakiti da jiran amsa.

    Misali: ping google.com

  4. curl <URL>: Dauke abun ciki daga URL. Ana amfani da wannan umarni sau da yawa don zazzage bayanai daga gidajen yanar gizo da nuna sakamakon akan layin umarni.

    Misali: curl https://www.example.com

Gudanar da Tarihin Umurni

  1. history: Nuna tarihin umarnin da aka aiwatar a baya. Wannan umarnin yana lissafin umarnin da aka aiwatar a zaman na yanzu.

    Misali: history

 

Waɗannan wasu umarni ne na gama-gari kuma masu fa'ida a cikin CentOS. Dangane da buƙatun ku da manufofin ku, zaku iya amfani da waɗannan umarni don sarrafa tsarin ku da aiwatar da ayyuka na asali.