Los ntawm analogy nrog lub qhov rais operating system, Linux muaj ib co txheej ntawm commands rau cov hauj lwm yooj yim thiab ceev nyob hauv operating system. Tab sis yog nyob rau hauv rooj plaub thawj peb hu rau lub chaw ua haujlwm lossis ua yeeb yam los ntawm "Command Line" (cmd), tom qab ntawd ces nyob rau hauv ob lub kaw lus, cov kev ua tau ua nyob rau hauv lub davhlau ya nyob twg. Yeej tseem zoo "Terminal" thiab "Hais kom ua kab" - nws yog qhov qub tshaj plaws.
Sau cov lus txib hauv "Terminal" Linux
Rau cov neeg uas nyuam qhuav pib paub cov kab kev khiav hauj lwm ntawm Linux tsev neeg, peb muab cov npe hauv qab ntawm cov lus tseem ceeb tshaj plaws uas tsim nyog rau txhua tus neeg siv. Nco ntsoov tias cov cuab yeej thiab cov khoom siv fais fab hu ua los ntawm "Terminal", yog pre-installed rau tag nrho Linux distributions thiab tsis tas yuav tsum tau preloaded.
Cov ntaub ntawv tswj
Nyob rau hauv txhua qhov kev khiav hauj lwm, ib tug ua tsis tau yam tsis koom nrog ntau hom ntaub ntawv. Feem ntau cov neeg siv los siv tus thawj tswj xyuas cov ntaub ntawv uas muaj lub khauj khaum rau qhov laj thawj no. Tab sis tag nrho cov tib manipulations, los yog txawm ib tug loj daim ntawv teev npe ntawm lawv, yuav nqa tawm siv tshwj xeeb commands.
- Ls - tso cai rau koj saib cov ntsiab lus ntawm cov directory. Nws muaj ob qho kev xaiv: -l - qhia txog cov ntsiab lus ua ib daim ntawv teev npe, -a - Qhia cov ntaub ntawv uas muab zais los ntawm lub system.
- miv - qhia cov ntsiab lus ntawm cov ntaub ntawv teev cia. Rau kab lej, qhov kev xaiv yog siv. -n .
- cd - siv los ntawm tus txheej txheem rau lub npe mus rau ib qho. Thaum pib tsis muaj cov kev xaiv ntxiv, nws redirects rau hauv paus directory.
- pw - ua hauj lwm pab txiav txim siab txog cov npe tam sim no.
- mkdir - tsim ib phau ntawv tshiab hauv phau ntawv qhia tam sim no.
- cov ntaub ntawv - qhia cov ncauj lus kom ntxaws txog cov ntaub ntawv.
- cp - yuav tsum tau luam ib daim nplaub tshev lossis ua ntaub ntawv. Thaum muab kev xaiv -r muaj xws li cov ntaub ntawv luam tawm. Kev xaiv -a txuag cov ntaub ntawv tseem ceeb ntxiv rau qhov kev xaiv yav dhau los.
- mv - siv los rhais lossis tshem tawm cov nplaub tshev / ntawv.
- RM - tshem tawm cov ntaub ntawv lossis cov ntawv nplaub tshev. Thaum siv tsis muaj kev xaiv, qhov kev tshem tawm yog qhov ruaj khov. Yuav tsiv mus rau lub laub, koj yuav tsum nkag mus rau qhov kev xaiv -r.
- ln - tsim ib qhov txuas rau cov ntaub ntawv.
- chmod - Cov cai hloov (nyeem, sau ntawv, hloov ...). Yuav tau muab cais rau txhua tus neeg siv.
- chown - tso cai rau koj hloov tus tswv. Tsuas yog siv rau SuperUser (Thawj Coj).
- nrhiav - tsim los tshawb nrhiav cov ntaub ntawv hauv lub system. Tsis zoo li cov pab pawg nrhiav tau, qhov kev tshawb nrhiav yog ua nyob rau hauv kho tshiab.
- dd - siv thaum tsim cov ntawv luam ntawm cov ntaub ntawv thiab hloov lawv.
- nrhiav tau - tshawb rau cov ntaub ntawv thiab cov ntawv sau cia hauv lub system. Nws muaj ntau txoj hau kev uas koj tuaj yeem siv kho koj qhov kev tshawb nrhiav.
- mount-umounth - siv los ua haujlwm nrog cov ntaub ntawv. Nrog nws cov kev pab, lub system yuav ua kom kaw lossis txuas nrog. Yuav siv, koj yuav tsum tau txais cov hauv paus-txoj cai.
- du - qhia ib qho piv txwv ntawm cov ntaub ntawv / folders. Kev xaiv -h hloov mus rau ib hom ntawv nyeem -S - qhia cov lus qhia luv luv, thiab -d - teev qhov tob ntawm recursions hauv Wage.
- df - soj ntsuam qhov chaw disk, uas koj yuav pom seb qhov seem ntawm qhov seem thiab qhov chaw sau. Nws muaj ntau txoj hauv kev uas cia koj los tsim cov ntaub ntawv tau txais.
Nco ntsoov: kom tau txais kev cai superuser (hauv paus-txoj cai), koj yuav tsum nkag mus "sudo su" (tsis muaj quotes).
Ua haujlwm nrog cov ntawv nyeem
Nkag mus rau hauv "Terminal" commands uas ncaj qha mus nrog cov ntaub ntawv yuav ntxov lossis tom qab yuav tsum tau hloov rau lawv. Cov lus txib nram qab no yog siv rau kev ua haujlwm nrog cov ntaub ntawv luam tawm:
- ntau dua - tso cai rau koj saib cov ntawv nyeem uas tsis haum rau thaj chaw ua haujlwm. Thaum tsis muaj qhov xaus, qhov kev siv niaj hnub siv dua. tsawg dua.
- grep - ua cov ntawv tshawb nrhiav los ntawm cov qauv.
- taub hau tail - thawj lo lus txib yog lub luag hauj lwm rau qhov tso tawm ntawm thawj ob peb kab ntawm pib ntawm daim ntawv (lub hau), qhov thib ob -
qhia cov kab kawg hauv daim ntawv. Yog lub neej ua ntej, 10 kab yog qhov tso tawm. Koj tuaj yeem hloov lawv cov naj npawb uas siv cov kev ua haujlwm -n thiab -f. - tsi - siv los xaiv cov kab. Rau cov zauv, qhov kev xaiv yog siv. -n, rau kev soj ntsuam los ntawm sab saum toj mus rau nram qab kawg - -r.
- diff - pauv thiab pom qhov txawv ntawm cov ntawv nyeem (kab los ntawm kab).
- wc - suav cov lus, hlua, bytes thiab cov cim.
Kev tswj kev ua haujlwm
Siv sijhawm ntev ntawm OS los ntawm kev sib tham ua kom muaj kev tshwm sim ntawm ntau yam kev ua dej num uas muaj peev xwm ua rau qhov kev kawm tsis zoo rau lub computer kom qhov taw qhia tias nws yuav tsis ua haujlwm nrog.
Qhov teeb meem no muaj peev xwm ua tau yooj yim kho kom yooj yim los ntawm ua kom tiav cov txheej txheem tsis tseem ceeb. Hauv Linux, cov lus txib nram qab no yog siv rau lub hom phiaj no:
- ps pgrep - Thawj cov lus samfwm qhia txog txhua yam hais txog kev ua haujlwm ntawm lub system (kev ua haujlwm "-e" qhia txog ib tus txheej txheem), qhov thib ob qhia txog tus txheej txheem ID tom qab tus neeg tau nkag los rau hauv nws lub npe.
- tua - xaus cov txheej txheem PID.
- xkill - Yog txhaj rau ntawm qhov txheej txheem qhov rai -
ua tiav nws. - pkill - xaus cov txheej txheem ntawm nws lub npe.
- killall terminates tag nrho cov txheej txheem active.
- saum toj, htop - yog lub luag haujlwm rau kev ua kom pom kev thiab siv raws li kev sib tham ntawm cov console. htop yog ntau hnub no.
- sij hawm - qhia txog "Terminal" cov ntaub ntawv rau lub sijhawm ntawm txoj haujlwm.
Tus neeg siv nruab nrab
Tus naj npawb ntawm cov lus txib tseem ceeb tsuas yog cov uas tso cai rau koj mus koom nrog lub hauv paus xwb, tab sis tseem ua ntau yam tsis tseem ceeb uas ua rau kom ua haujlwm nrog lub computer.
- hnub tim - qhia hnub thiab lub sijhawm ntawm ntau hom ntawv (12 h, 24 h), nyob ntawm qhov kev xaiv.
- alias - tso cai rau koj kom txo tau cov lus txib los yog tsim kom muaj ib lub ntsiab lus rau nws, ua ib los sis ib koog ntawm ntau cov lus txib.
- uname - muab cov ntaub ntawv ntawm lub npe ua haujlwm ntawm lub system.
- sudo sudo su - Tus thawj sau npe rau ib qho ntawm cov neeg siv ntawm kev khiav hauj lwm. Qhov thib ob yog sawv cev ntawm tus Super User.
- pw - muab lub computer tso rau hauv hom kev pw tsaug zog.
- shutdown - hloov lub computer tam sim ntawd, kev xaiv -h tso cai rau koj mus kaw lub koos pis tawj ntawm lub sij hawm dhau los.
- reboot - rov pib dua lub computer. Koj tseem tuaj yeem teem caij tshwj xeeb rov qab siv cov kev xaiv tshwj xeeb.
Kev Tswj Tus Neeg Siv
Thaum ntau tshaj ib tug neeg ua hauj lwm hauv tib lub computer, tab sis ntau, cov creation ntawm ntau cov neeg siv yuav yog qhov zoo tshaj plaws kev xaiv. Txawm li cas los xij, koj yuav tsum paub cov lus txib kom sib cuam tshuam nrog txhua tus ntawm lawv.
- useradd, userdel, usermod - ntxiv, rho tawm, kho kom raug neeg siv nyiaj, feem.
- passwd - ua hauj lwm pab hloov tus password. Khiav li Super neeg siv (sudo su thaum pib ntawm qhov hais kom ua) pub koj rov qab cov passwords ntawm txhua tus account.
Saib cov ntaub ntawv
Cov neeg siv tsis muaj peev xwm nco qab lub ntsiab lus ntawm tag nrho cov lus txib hauv qhov system los yog qhov chaw ntawm tag nrho cov kev pab cuam cov ntaub ntawv, tab sis peb qho yooj yim nco ntsoov commands yuav tuaj rau tus cawm:
- qhov twg - Qhia txog txoj kev rau cov ntaub ntawv executable.
- tus txiv neej - Qhia kev pab lossis qhia rau pab neeg, uas siv rau hauv cov lus txib nrog tib phab.
- dab tsi - Ib qho analogue ntawm cov lus hais saum toj no, tab sis qhov no yog siv los nthuav qhia cov seem kev pab.
Network tswj
Txhawm rau txhim kho hauv Internet thiab ua kom muaj kev txhim kho mus rau qhov chaw nyob yav tom ntej, koj yuav tsum paub tsawg kawg ib co lus txib rau qhov no.
- ip - teem caij network subsystems, saib muaj cov chaw nres nkoj IP rau kev txuas. Thaum muab tus attribute -show qhia cov khoom ntawm cov hom kev qhia ua ib daim ntawv, nrog rau tus cwj pwm -help Cov ntaub ntawv siv tau tso tawm.
- ping - kev tshawb nrhiav kev txuas mus rau qhov chaw sib txuas lus (router, router, modem, etc.). Tseem ceeb toom cov ntaub ntawv hais txog kev sib txuas lus zoo.
- nethogs - muab cov ntaub ntawv rau tus neeg siv txog kev noj cov tsheb. Tus Cwj Pwm -i teev lub network interface.
- tracerout - pab pawg analog ping, tab sis nyob rau hauv ib daim ntawv zoo dua tuaj. Nws qhia tau hais tias tus ceev ntawm kev xa cov ntaub ntawv rau txhua tus ntawm cov ntshav thiab muab cov lus qhia txog tag nrho lawv ntawm kev xa cov ntaub ntawv sib kis.
Xaus
Paub tag nrho cov saum toj no commands, txawm tias ib tug novice uas tau cia li ntsia lub Linux raws li lawv, yuav muaj peev xwm kom txuam nrog nws, ntse daws cov haujlwm. Thaum xub thawj glance nws yuav zoo li tias daim ntawv tseem ceeb heev kom nco qab, txawm li cas los, nrog kev tua ntawm ib pab neeg dhau sij hawm, cov tseem ceeb yuav poob mus rau hauv lub cim xeeb, thiab koj yuav tsis tau xa mus rau cov lus qhia los ntawm peb txhua lub sijhawm.