Unix Commands
- Command : alias
- Function : allow a string to be substituted for a word when it is used as the first word of a simple command.
- Syntax : alias [-p] [name[=value] …]
- Example : alias cls=’clear’
cls
- Command : cat
- Function : To view / display a file.
- Syntax : cat (file name)
- Example : cat a1.txt
- Command : cd
- Function: To change the directory.
- Syntax : cd (directory name)
- Example : cd IT1
- Command : clear
- Function: To clear the screen.
- Syntax : clear
- Command : Copy / cp
- Function : To copy the directory and its file to another directory. / to copy file
- Syntax : cp –r (source directory) (destination directory)
- Example : cp –r IT1/ IT2
- Syntax : cp (source filename) (destination filename)
- Example : cp a1.txt a2.txt
- Command : date
- Function : To print date and time.
- Syntax : date
- Command : finger
- Function : to find information about computer users
- Syntax : finger [email protected]
- Command : fold
- Function : folding contents of specified files, or standard input. (default 80 columns.)
- Syntax : fold –w <number of columns> –s <filename>
- Example : fold –w 5 –s a1.txt
- Command : history
- Function : To view the commands which was executed
- Syntax : history
- Command : listing directory
- Function : To list only the directories with in a directory.
- Syntax : ls -d
- Command : ls
- Function : To list the contents of a directory.
- Syntax : ls
- Command : man
- Function : Show manual for a command
- Syntax : man (command)
- Example : man cat
- Command : mkdir
- Function: To create a directory.
- Syntax : mkdir (directory name)
- Example : mkdir CIVIL
- Command : move / mv
- Function :To rename a directory / file
- Syntax : mv (directory 1) (directory 2)
- Example : mv CIVIL IT
- Syntax : mv (old file name) (new file name)
- Example : mv a1.txt a2.txt
- Command : passwd
- Function : to change current user password
- Syntax : passwd
- Command : ps
- Function : Displays Process status. Result contains four columns of information – pid (unique process id), tty (terminal), time (amount of time the process has been running) and cmd (name of the command that launched the process)
- Syntax : ps
- Command : pwd
- Function : To print present working directory. / To display complete path of the working directory.
- Syntax : pwd
- Command : rm
- Function : to delete or remove files
- Syntax : rm <filename>
- Example : rm a1.txt
- Command : rd / rmdir
- Function : To remove directory.
- Syntax : rmdir (empty directory name)
- Example : rmdir IT1
- Syntax : rmdir –r (non-empty directory name)
- Example : rmdir –r IT2
- Command : tar
- Function : to create compressed archive files and that can be moved easily from one disk to another disk or machine to machine.
- Syntax : tar <tar_file_name> <name of directory to be compressed>
- Example : tar a1.tar /home/exam01/
- Command : top
- Function : Display processor activity of server and tasks managed by kernel in real-time.
- Syntax : top
- Command : wait
- Function : Wait for process to terminate, and return its exit status
- Syntax : wait <pid>
- Command : who
- Function : To find out who is logged in. / To print who is using the system presently.
- Syntax : who
- Command : whoami
- Function : Display user name.
- Syntax : whoami