Tono Basic Linux i runga i Linux me Windows Whakahaere Systems

Ko te whai hua tenei tuhituhi mo te hunga e hiahia ana ki te tīmata ki Linux whakahau. Here you will find the most common commands that are used in Linux.

Ki te hiahia koe ki te whakahaere i Linux whakahau i runga i Windows ka tāuta Cygwin. Cygwin is a Linux layer on top of Windows that allows you to use Linux commands in Windows.

Ki te tāuta koe Cygwin i runga i Windows na te ara taunoa ina tīmata koe e te tauranga Cygwin:

C:\cygwin64\home\{username}

 

Waihanga tauira kōnae Pukatuhi hou

touch textfile.txt

 

Huri whaiaronga

cd {directory path\name}

 

List directory content in long format ( -l ) including hidden files and directories ( -a )

ls -l -a

ls -al

 

Order files and directories by the time they were last modified

ls -t

 

List directory with pause and scrolling

ls -l | less

 

Whakaaturia tauwāhi o nāianei (print working directory)

pwd

 

Unu whakamutunga 100 kupu o te kōnae

tail -100 {filename.extension}

 

Unu tuatahi 100 rarangi o te kōnae

head -100 {filename.extension}

 

Tāruatia te kōnae

cp {source} {destination}

 

Nuku i te kōnae

mv {source} {destination}

 

Hanga he whaiaronga hou

mkdir {new directory name}

 

Mukua te kōnae

rm {filename}

 

Delete an empty directory

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

 

Delete directory and its contents

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

 

Kōmakatia te tirotiro o te kōnae

sort {filename to sort}

 

Tangohia ngā tāurunga tāruarua i roto i te kōnae

uniq {filename to remove duplicates}

 

Kōpeke kōnae

gzip {filename}

 

Kōpeke whaiaronga

gzip -r {directory name}

 

Tatauria te maha o ngā rārangi, me te kupu i roto i te kōnae kuputuhi

wc {filename}

 

Search text within files for matching string pattern (case sensitive)

grep 'word' {filename}

 

Search text within files for matching string pattern (case insensitive)

grep -i 'word' {filename}

 

Search with a directory

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

 

Whakaatu ihirangi o te kōnae kuputuhi

cat

 

sed stream editor (similar to find and replace)

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

 

Hurihia ngā whakaaetanga kōnae me te whaiaronga

chmod {options} {permissions} {filename}

 

Hiki whakahau tata whakamahia

history

 

Tabula aunoa mahi

cron
crontab

 

Whakaaetanga Huria kōnae

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

 

Hurihia ngā whakaaetanga kōnae recursive

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