Basic Linux skipanir á Linux og Windows stýrikerfi

This writing is useful for those that wish to get started with Linux commands. Here you will find the most common commands that are used in Linux.

If you would like to run Linux commands on Windows then install Cygwin. Cygwin is a Linux layer on top of Windows that allows you to use Linux commands in Windows.

Ef þú setur Cygwin á Windows þá sjálfgefna slóð þegar þú byrjar Cygwin flugstöðinni verður:

C:\cygwin64\home\{username}

 

Búa til nýja skrifblokk skrá dæmi

touch textfile.txt

 

Breyta skrá

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

 

Sýna núverandi staðsetningu (print working directory)

pwd

 

Olía síðasta 100 Orð skrá

tail -100 {filename.extension}

 

Olía fyrst 100 raðir af skrá

head -100 {filename.extension}

 

Afrita skrá

cp {source} {destination}

 

Færa skrá

mv {source} {destination}

 

Gera nýja möppu

mkdir {new directory name}

 

Eyða skrá

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}

 

Raða innihald skrá

sort {filename to sort}

 

Fjarlægja afrit færslur í skrá

uniq {filename to remove duplicates}

 

Þjappa skrám

gzip {filename}

 

Þjappa möppu

gzip -r {directory name}

 

Telja fjölda lína og orða í texta skrá

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

 

Sýna innihald textaskrá

cat

 

sed stream editor (similar to find and replace)

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

 

Breyting skrá og skrá heimildir

chmod {options} {permissions} {filename}

 

Listi nýlegar skipanir notaðar

history

 

Sjálfkrafa skipuleggja verkefni

cron
crontab

 

Breyta skrá heimildir

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

 

Breyting endurkvæma skrá heimildir

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

 

 

Skildu eftir svar