Some Important Linux Terminal Commands

Here are the some important and most frequently used linux Command that every linux user must know, command like clear, sudo, mkdir, rm, touch, ls, cp, cd, cat, pwd, passwd, whereis, whoami, whatis, bc, du, df and other commands

Linux Commands

1. ls - List the content of the folder from which it runs

Syntax - ls

Example - ls -l and ls -a

2. mkdir - mkdir command is used to create new directory

Syntax -mkdir directory_name

Example - mkdir student

3. cat - To create file with content and can concatenate two or more file content

Syntax - cat > filename

Example - cat>student

4. touch - It is used to create file without content

Syntax - touch filename

Example - touch student

5. cp - It copies a file from one location to another location

Syntax - cp source_file destination_file

Example - cp student stud1

6. cd - It is used to change the directory

Syntax - cd directory_name

Example - cd Desktop

7. mv - It used to move a file from one location to another location

Syntax - mv source_file destination_file

Example - mv student1 student2

8. pwd - It print the present working directory with full path name from terminal

Syntax - pwd

Example - pwd

9. whereis - It is used to locate the sources and manual page of the command

Syntax - whereis command_name

Example - whereis cat

10. whatis - It is helpful to get brief information about linux commands

Syntax - whatis command_name

Example - whatis cp

11. which - It is used to locate executable file in the system

Syntax - which command_name

Example - which cpp python java

12. man - It provides online documentation for all the possible options with a command and its usages

Syntax - man command_name

Example - man cat

13. info - It provides online documentation for all the commands but in a better structured way

Syntax - info command_name

Example - info cp

14. whoami - It is used to find out the current user of the terminal

Syntax - whoami

Example - whoami

15. bc - It means basic calculator, It used for the basic calculation

Syntax - bc

Example - echo '2+2' | bc

16. grep - It searches the given file for lines containing a match to the given string or words

Syntax - grep word filename

Example - grep mv student

17. head - It prints the first 10 lines of the given file

Syntax - head filename

Example - head student.txt

18. tail - It print the last 10 lines of the given file

Syntax - tail filename

Example - tail student.txt

19. tac - It print the content of the given file in reverse order

Syntax - tac filename

Example - tac student.txt

20. echo - It print text on the standard output, However in an interactive script echo passes the message to the user through terminal

Syntax - echo Hello world

Example - echo Hello world

21. df - Report disk usages of file system useful for user as well as system administrator to keep track of their disk usages.

Syntax - df

Example - df

22. du - It estimate file space usages. df only report usages statistics on file system while du on the other hand measures directory content.

Syntax - du

Example - du

23. ps - It stands for process, It gives the status of running process with a unique ID called PID

Syntax - ps

Example - ps

24. alias - It is built in shell command that lets you assign name for a long command or frequently used command

Syntax - alias alias_name command

Example - alias q=ls

25. uname - It stands for unix name, It print detailed infromation about the machine name, operating system and kernel

Syntax - uname

Example - uname

26. sudo - It allows a permitted user to execute a command as the super user

Syntax - sudo command

Example - sudo passwd

27. su - It is used to run shell with substitute user and group IDs, It help to change login session's owner without the owner having to first logout of that session

Syntax - su username

Example - su username

28. history - It print the history of long list executed command in the terminal

Syntax - history

Example - history

29. passwd - It is used for changing the password, you must know the current password for the security reason

Syntax - passwd

Example - passwd

30. date - It print the current date and time on the standard output and can further be set

Syntax - date

Example - date

31. cal - It is used to display calendar of the present month or any other month

Syntax - cal [month] [year]

Example - cal 08 2001

32. clear - It is used to clear the terminal screen

Syntax - clear

Example - clear