Unix Commands - Commonly used Commands


Unix Commands 

1. Command : alias
a. Function : allow a string to be substituted for a word when it is used as the first word of a 
                                   simple command.
b. Syntax : alias [-p] [name[=value] …]
c. Example : alias cls=’clear’
                                   cls

2. Command : cat
a. Function : To view / display a file.
b. Syntax : cat (file name)
c. Example : cat a1.txt

3. Command : cd
a. Function: To change the directory.
b. Syntax : cd (directory name)
c. Example : cd IT1

4. Command : clear
a. Function: To clear the screen.
b. Syntax : clear

5. Command : Copy / cp
a. Function : To copy the directory and its file to another directory. / to copy file
b. Syntax : cp –r (source directory) (destination directory)
c. Example : cp –r IT1/ IT2
d. Syntax : cp (source filename) (destination filename)
e. Example : cp a1.txt a2.txt

6. Command : date
a. Function : To print date and time.
b. Syntax : date

7. Command : finger
a. Function : to find information about computer users
b. Syntax : finger username@node.domain

8. Command : fold
a. Function : folding contents of specified files, or standard input. (default 80 columns.) 
b. Syntax : fold –w <number of columns> –s <filename> 
c. Example : fold –w 5 –s a1.txt

9. Command : history
a. Function : To view the commands which was executed
b. Syntax : history

10. Command : listing directory
a. Function : To list only the directories with in a directory.
b. Syntax : ls -d

11. Command : ls
a. Function : To list the contents of a directory.
b. Syntax : ls

12. Command : man
a. Function : Show manual for a command
b. Syntax : man (command)
c. Example : man cat

13. Command : mkdir
a. Function: To create a directory.
b. Syntax : mkdir (directory name)
c. Example : mkdir CIVIL

14. Command : move / mv
a. Function :To rename a directory / file
b. Syntax : mv (directory 1) (directory 2)
c. Example : mv CIVIL IT
d. Syntax : mv (old file name) (new file name)
e. Example : mv a1.txt a2.txt

15. Command : passwd
a. Function : to change current user password
b. Syntax : passwd

16. Command : ps
a. 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)
b. Syntax : ps

17. Command : pwd
a. Function : To print present working directory. / To display complete path of the working directory.
b. Syntax : pwd

18. Command : rm
a. Function : to delete or remove files 
b. Syntax : rm <filename>
c. Example : rm a1.txt 

19. Command : rd / rmdir
a. Function : To remove directory.
b. Syntax : rmdir (empty directory name)
c. Example : rmdir IT1
d. Syntax : rmdir –r (non-empty directory name)
e. Example : rmdir –r IT2


20. Command : tar
a. Function : to create compressed archive files and that can be moved easily from one disk to another disk or machine to machine.
b. Syntax : tar <tar_file_name> <name of directory to be compressed>
c. Example : tar a1.tar /home/exam01/

21. Command : top
a. Function : Display processor activity of server and tasks managed by kernel in real-time.
b. Syntax : top
  
22. Command : wait
a. Function : Wait for process to terminate, and return its exit status
b. Syntax : wait <pid>

23. Command : who
a. Function : To find out who is logged in. / To print who is using the system presently.
b. Syntax : who

24. Command : whoami
a. Function : Display user name.
b. Syntax : whoami


No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu