Unix/Linux Command Reference

File Commands
1. 2. 3. 4. 5. 6. 7. 8. 9. ls ls -al ls -lt cd dir cd pwd mkdir 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 current working directory Creating a directory dir Places the standard input into the file Output the contents of the file Output the first 10 lines of the file Output the last 10 lines of the file Output the contents of file as it grows,starting with the last 10 lines Create or update file Deleting the file Deleting the directory Force to remove the file Force to remove the directory dir Copy the contents of file1 to file2 Copy dir1 to dir2;create dir2 if not present Rename or move file1 to file2,if file2 is an existing directory Create symbolic link link to file

10. head file 11. tail file 12. tail -f file 13. touch file 14. rm file 15. rm -r dir 16. rm -f file 17. rm -rf dir 18. cp file1 file2 19. cp -r dir1 dir2 20. mv file1 file2 21. ln -s file link

Process management
1. 2. ps top To display the currently working processes Display all running process

Unix/Linux Command Reference 

3. 6. returns their ID 6. by default. • 4-read(r) • 2-write(w) • 1-execute(x) Searching 1.world by adding. 4. 4. 5. 7.resume a stopped job in the background Brings the most recent job to foreground Brings job n to the foreground File permission 1. for files and directories with names starting with filename Searches for all the named processes . pgrep pattern System Info 1. 8. 4. 3. 2. 2. kill pid killall proc pkill pattern bg fg fg n Kill the process with given pid Kill all the process named proc Will kill all processes matching the pattern List stopped or background jobs. that matches with the pattern and. 5.3. -name filename Search for pattern in file Search recursively for pattern in dir Search pattern in the output of a command Find all instances of file Searches in the current directory (represented by a period) and below it. date cal uptime w whoami Show the current date and time Show this month's calender Show current uptime Display who is on line Who you are logged in as Unix/Linux Command Reference  .group. grep pattern file grep -r pattern dir command | grep pattern locate file find .which can be found separately for user. 5. chmod octal file Change the permission of file to octal.

2. 3. finger user uname -a cat /proc/cpuinfo cat proc/meminfo Display information about user Show kernel information Cpu information Memory information Show the manual for command Show the disk usage Show directory space usage Show memory and swap usage Show possible locations of app Show which applications will be run by default 10. 3. whereis app 15.tar.tar containing file Extract the files from file. free 14. 9. 7. 6.tar tar czf file.gz files tar xzf file.gz Decompresses file. 4. man command 11.tar. 5. 6. which app Compression 1. df 12. 5. 7. 8.gz Create tar named file. tar cf file.gz tar cjf file.tar.tar Create a tar with Gzip compression Extract a tar using Gzip Create tar with Bzip2 compression Extract a tar using Bzip2 Compresses file and renames it to file. ping host whois domain dig domain dig -x host wget file wget -c file Ping host and output results Get whois information for domains Get DNS information for domain Reverse lookup host Download file Continue a stopped download Unix/Linux Command Reference  .tar.bz2 tar xjf file.tar file tar xf file. 8.6. 2.gz back to file Network 1. 4.bz2 gzip file gzip -d file. du 13.

similar to exit Erases one word in the current line Erases the whole line Type to bring up a recent command Repeats the last command Logout the current session Unix/Linux Command Reference  . 5. 6. resume with fg in the foreground or bg in the background Logout the current session. 8. 4. ctrl+c ctrl+z ctrl+d ctrl+w ctrl+u ctrl+r !! exit Halts the current command Stops the current command. 3. 2. 7.Shortcuts 1.

Sign up to vote on this title
UsefulNot useful