Commonly Used Linux Terminal Commands You Should Know

Must read

Anwer Khan
Anwer Khan
Anwer is passionate about helping others to understand this complex web called the Internet. He also has interests Mobile Phones, Movies and Golf.

The Command Line is quite a powerful tool for Linux, and once you get the hang of it, you can do things on the system a lot faster although controlling things from the be pretty intimidating.

So, what you can do to be more efficient, is to do it regularly. And to get started, here are some of the most common commands you should know.

I strongly suggest you recommend you bookmark this page or print it out for reference.

1. ls

ls brings up the list of all the folders and files in the directory you are in. Simply launch the terminal and type the command ls.


The ls command can also be used to reveal hidden files with the “a” command line switch.

ls -a

2. cd

cd command is used to change directories. Simply type the command, followed by the directory path. like path/abc/efg

cd /path/to/location/

You can also go backwards up a directory by using “..”

cd ..

3. pwd

To show the current directory in the linux terminal use the pwd command.


4. mkdir

This helps you create a new folder, in the directory you are in.


5. rm

You can use ‘rm’ command to delete a file.

rm /path/to/file

Similarly, you can use the ‘rf’ command to delete the folder along with the files it is containing.

rm -rf /path/to/folder

6. cp

‘cp’ is used for making a copy of a file or a folder.

To copy a file, use cp followed by the location of the file.

cp /path/to/file

Or, to copy a folder, use cp with the “r” command line switch

cp -r /path/to/folder

7. mv

The mv command can do a lot of things on Linux. It can move files around to different locations, but it can also rename files.

To move a file from one location to another, try the following example.

mv /path/to/file /place/to/put/file|

8. cat

The cat command will let you view the contents of files in the terminal. To use cat, write the command out followed by the location of the file you’d like to view. For example:

cat /location/of/file

9. head

Head lets you view the top 10 lines of a file. To use it, enter the head command followed by the location of the file.

head /location/of/file

10. tail

Tail lets you view the bottom 10 lines of a file. To use it, enter the tail command followed by the location of the file.

tail /location/of/file

11. ping

On Linux, the ping command lets you check the latency between your network and a remote internet or LAN server.



ping IP-address

To ping only a few times, use the ping command followed by the “c” command line switch and a number. For example, to ping Google 3 times, do:

ping -c3

12. uptime

To check how long your Linux system has been online, use the uptime command.


13. uname

The uname command can be used to view your current distribution codename, release number, and even the version of Linux you are using. To use uname, write the command followed by the “a” command line switch.

Using the “a” command line switch prints out all information, so it’s best to use this instead of all other options.

uname -a

14. man

Using the man command, you can view the instruction manual of any program. To take a look at the manual, run the man command followed by the name of the program. For example, to view the manual of cat, run:

man cat

15. df

Df is a way to easily view how much space is taken up on the file system(s) on Linux. To use it, write the df command.


To make df more easily readable, use the “h” command line switch. This puts the output in “human readable” mode.

df -h

16. du

Need to view the space that a directory on your system is taking up? Make use of the du command. For example, to see how big your /home/ folder is, do:

du ~/

To make the du output more readable, try the ‘hr” command-line switch. This will put the output in “human readable” mode.

du ~/ -hr

17. whereis

Using whereis, you can track down the exact location of an item in the command-line. To find the location of the Firefox binary on your Linux system, you can run:

whereis firefox

18. locate

Searching for files, programs, and folders on the Linux command-line is made easy with locate. To use it, just write out the locate command, followed by a search term.

locate search-term

19. grep

With the grep command, it’s possible to search for a pattern. A good example use of the grep command is to use it to filter out a specific line of text in a file.

Understand that grep isn’t a command that should ever be run by itself. Instead, it must be combined, like so:

cat text-file.txt | grep 'search term'

Essentially, to use grep to search for patterns, remember this formula:

command command-operations | grep 'search term'

20. ps

To view current running processes directly from the Linux terminal, make use of the ps command.


Need a more full, detailed report of processes? Run ps with aux.

ps aux

21. kill

Sometimes, you need to kill a problem program. To do this, you’ll need to take advantage of the kill command. For example, to close Firefox, do the following.

First, use pidof to find the process number for Firefox.


Then, kill it with the kill command.

kill process-id-number

Still won’t close? Use the “9” command-line switch.

kill -9 process-id-number

22. killall

Using the killall command, you can end all instances of a running program. To use it, run the killall command followed by the name of a program. For example, to kill all running Chrome processes, type this:

killall chrome

23. curl

You can use curl to download a file from the Internet. To start a download, write the curl command followed by the file’s URL, the >symbol and the location you’d like to save it. For example:

curl > ~/Downloads/

24. free

Running out of memory? Check your swap space and free RAM space with the free command.


25. chmod

With chmod, it’s possible to update the permissions of a file or folder.

Change the permissions of a file, so everyone on the PC can read, write and execute it, type this:

chmod +rwx /location/of/file-or/folder/

For updating the permissions, so only the owner has access,use this:

chmod +rw

To update permissions for a specific group, or the world on the Linux system, run:

chmod +rx

So, these are few of the commonly used commands in the Linux command line too. Surely, it does help the normal users to access the system using a visual interface, but the command line has its own base, and if you are looking to learn, this article can be a good start.

Source: Addictive Tips
- Advertisement -

Related Articles

Latest Articles