Theem pib Linux Commands Linux thiab lub qhov rais Operating nruab

Sau ntawv no yuav pab tau rau cov neeg uas xav pib nrog Linux commands. Ntawm no koj yuav nrhiav tau tus tshaj commands uas siv nyob rau hauv Linux.

Yog hais tias koj xav khiav Linux commands Qhov rais ces nruab Cygwin. Cygwin yog ib txheej Linux nyob saum qhov rais uas tso cai rau koj siv Linux commands qhov rais.

Yog hais tias koj nruab Cygwin qhov rai ces vim kev thaum koj pib lub davhlau ya nyob twg Cygwin yuav:

C:\cygwin64\home\{username}

 

Ua piv txwv li notepad txog ntaub ntawv tshiab

touch textfile.txt

 

Hloov directory

cd {directory path\name}

 

Daim ntawv teev directory kawm hom ntawv ntev ( -l ) Thaum cov ntaub ntawv thiab Wage ( -ib )

ls -l -a

ls -al

 

Kev txiav txim cov ntaub ntawv thiab Wage txij thaum lawv tau kawg hloov

ls -t

 

Daim ntawv teev directory mas thiab scrolling

ls -l | less

 

Qhia qhov chaw nyob tam sim no (sau ua hauj lwm directory)

pwd

 

Extract kawg 100 lo lus los ntawm ib cov ntaub ntawv

tail -100 {filename.extension}

 

Extract xub 100 natwm ntawm ib cov ntaub ntawv

head -100 {filename.extension}

 

Luam ib cov ntaub ntawv

cp {source} {destination}

 

Txav mus rau ib daim ntawv

mv {source} {destination}

 

Ua ib tug tshiab directory

mkdir {new directory name}

 

Rho tawm ntaub ntawv

rm {filename}

 

Rho tawm tus npliag directory

rmdir {directory to remove}
rm -d{directory to remove}

 

Rho tawm directory thiab nws txheem

rm -r {directory to remove}
rm -R{directory to remove}

 

Txheeb tus txheem uas muaj ntaub ntawv

sort {filename to sort}

 

Tshem duplicate nkag rau hauv ntaub ntawv ib

uniq {filename to remove duplicates}

 

Hlob ntaub ntawv

gzip {filename}

 

Hlob directory

gzip -r {directory name}

 

Suav lub txoos natwm thiab lo lus nyob rau hauv ib phau ntawv cia

wc {filename}

 

Nrhiav cov ntawv nyeem nyob rau hauv cov ntaub ntawv rau txoj hlua txawv (nab rhiab)

grep 'word' {filename}

 

Nrhiav cov ntawv nyeem nyob rau hauv cov ntaub ntawv rau txoj hlua txawv (rooj loog)

grep -i 'word' {filename}

 

Nrhiav kev nrog ib directory

grep -R Arctic /home/ccuser/workspace/geography

 

Tso saib cov lus qhia hauv ib phau ntawv cia

cat

 

sed kwj editor (zoo li nrhiav thiab hloov)

sed 's/snow/rain/' forests.txt

 

Hloov cov ntaub ntawv thiab ntawv permissions

chmod {options} {permissions} {filename}

 

Daim ntawv teev tsis ntev los no commands siv

history

 

Yuav teem kev pab raws qib

cron
crontab

 

Hloov cov ntaub ntawv permissions

chmod {permission number} {some file or directory}
chmod 777 /storage

 

Kev hloov recursive ntaub ntawv permissions

chmod -R {permission number} {some file or directory}

 

 

sau ntawv cia