UNIX COMMANDS
LEARN IMPORTANT UNIX COMMANDS
List the files : ls (Lower case L and lower case S)
List all files : ls -a
Create Directory : mkdir
Change the directory name : cd directory
Change to home directory : cd
Change to home directory : cd ~
Change to parent directory : cd..
Display the path of current directory : pwd
Copy file1 to file2 : cp file1 file2
Move file1 to file2 : mv file1 file2
Delete file : rm file
Delete a directory : rmdir directory
Display a file : cat file
Display a file page : less file
Display first few lines of file : head file
Display last few lines of file : tail file
Search a file with keyword : grep ‘keyword’ file
Count number of lines/words/characters in a file : wc file
Redirect standard output to a file : command > file
Appand standard output to a file : command >> file
Redirect standard input from a file : command < file
Concatenate file1 and file2 to file0 : cat file1 file2 > file0
Pipe the output of comman1 to the input of command2 : command1 | command2
Sort data : sort
List user currently logged in : who
Match any number of character : *
Match one character : ?
read the online manual page for a command : man command
brief description of a command : whatis command
match commands with keyword in their man pages : apropos keyword
list access rights for all files : ls -lag
change access rights for named file : chmod [options] file
run command in background : command &
kill the job running in the foreground : ^C
suspend the job running in the foreground : ^Z
background the suspended job : bg
list current jobs : jobs
foreground job number 1 : fg %1
kill job number 1 : kill %1
list current processes : ps
kill process number 12345 : kill 12345
Disk usages and limits : quota
Leave a Reply