Osnovne Linux komande na Linux i Windows operativne sisteme

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.

Ako instalirate Cygwin na Windows zatim default stazu kada pokrenete Cigvin terminal će biti:

C:\cygwin64\home\{username}

 

Stvoriti novi primjer notepad file

touch textfile.txt

 

Promijenite direktorij

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

 

Pokaži trenutne lokacije (print working directory)

pwd

 

Ekstrakt posljednji 100 riječima datoteke

tail -100 {filename.extension}

 

Prvi Extract 100 redova datoteke

head -100 {filename.extension}

 

Kopiranje datoteke

cp {source} {destination}

 

Premještanje datoteke

mv {source} {destination}

 

Napravite novi direktorij

mkdir {new directory name}

 

Obriši datoteku

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}

 

Sortirati sadržaj datoteke

sort {filename to sort}

 

Ukloniti duple stavke u datoteci

uniq {filename to remove duplicates}

 

Compress datoteka

gzip {filename}

 

Compress direktorij

gzip -r {directory name}

 

Računati broj redova i riječi u tekstualnu datoteku

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

 

Prikaz sadržaj tekstualne datoteke

cat

 

sed stream editor (similar to find and replace)

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

 

Promjene datoteke i imenik dozvole

chmod {options} {permissions} {filename}

 

List nedavne naredbe koriste

history

 

Automatski zakazati zadatke

cron
crontab

 

Promjenu dozvole za datoteku

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

 

Promijeni rekurzivna dozvole datoteke

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

 

 

Komentariši