You are on page 1of 4

Unix/Linux Command Reference

File Commands
1. 2. 3. 4. 5. 6. #. $. '. ls ls -al ls -lt cd dir cd wd m"dir dir cat %file more file Directory listing Formatted listing with hidden files Sorting the Formatted listing by time modification Change directory to dir Change to home directory Show c!rrent wor"ing directory Creating a directory dir &laces the standard in !t into the file (!t !t the contents of the file (!t !t the first 1) lines of the file (!t !t the last 1) lines of the file (!t !t the contents of file as it grows*starting with the last 1) lines Create or ! date file Deleting the file Deleting the directory Force to remo+e the file Force to remo+e the directory dir Co y the contents of file1 to file2 Co y dir1 to dir2,create dir2 if not resent -ename or mo+e file1 to file2*if file2 is an e.isting directory Create symbolic lin" lin" to file

1). head file 11. tail file 12. tail -f file 13. to!ch file 14. rm file 15. rm -r dir 16. rm -f file 1#. rm -rf dir 1$. c file1 file2 1'. c -r dir1 dir2 2). m+ file1 file2 21. ln -s file lin"

&rocess management
1. 2. s to /o dis lay the c!rrently wor"ing rocesses Dis lay all r!nning rocess

Unix/Linux Command Reference

3. 4. 5. 6. #. $.

"ill id "illall roc "ill attern bg fg fg n

0ill the rocess with gi+en id 0ill all the rocess named roc 1ill "ill all rocesses matching the attern 2ist sto ed or bac"gro!nd 3obs*res!me a sto 3ob in the bac"gro!nd 4rings the most recent 3ob to foregro!nd 4rings 3ob n to the foregro!nd ed

File ermission
1. chmod octal file Change the ermission of file to octal*which can be fo!nd se arately for !ser*gro! *world by adding* 4-read5r6 2-write5w6 1-e.ec!te5.6

Searching
1. 2. 3. 4. 5. gre attern file Search for attern in file gre -r attern dir command 7 gre attern locate file find . -name filename Search rec!rsi+ely for attern in dir Search attern in the o!t !t of a command Find all instances of file Searches in the c!rrent directory 5re resented by a eriod6 and below it* for files and directories with names starting with filename Searches for all the named rocesses * that matches with the attern and* by defa!lt* ret!rns their 8D

6.

gre

attern

System 8nfo
1. 2. 3. 4. 5. date cal ! time w whoami Show the c!rrent date and time Show this month9s calender Show c!rrent ! time Dis lay who is on line 1ho yo! are logged in as

Unix/Linux Command Reference

6. #. $. '.

finger !ser !name -a cat : roc:c !info cat roc:meminfo

Dis lay information abo!t !ser Show "ernel information C ! information ;emory information Show the man!al for command Show the dis" !sage Show directory s ace !sage Show memory and swa !sage Show ossible locations of a Show which a lications will be r!n by defa!lt

1). man command 11. df 12. d! 13. free 14. whereis a 15. which a

Com ression
1. 2. 3. 4. 5. 6. #. $. tar cf file.tar file tar .f file.tar tar c=f file.tar.g= files tar .=f file.tar.g= tar c3f file.tar.b=2 tar .3f file.tar.b=2 g=i file g=i -d file.g= Create tar named file.tar containing file <.tract the files from file.tar Create a tar with >=i com ression <.tract a tar !sing >=i Create tar with 4=i 2 com ression <.tract a tar !sing 4=i 2 Com resses file and renames it to file.g= Decom resses file.g= bac" to file

?etwor"
1. 2. 3. 4. 5. 6. ing host whois domain dig domain dig -. host wget file wget -c file &ing host and o!t !t res!lts >et whois information for domains >et D?S information for domain -e+erse loo"! host Download file Contin!e a sto ed download

Unix/Linux Command Reference

Shortc!ts
1. 2. 3. 4. 5. 6. #. $. ctrl@c ctrl@= ctrl@d ctrl@w ctrl@! ctrl@r BB e.it Aalts the c!rrent command Sto s the c!rrent command* res!me with fg in the foregro!nd or bg in the bac"gro!nd 2ogo!t the c!rrent session* similar to e.it <rases one word in the c!rrent line <rases the whole line /y e to bring ! a recent command -e eats the last command 2ogo!t the c!rrent session

Unix/Linux Command Reference

You might also like