12 Basic Linux commands you should know

There are plenty of Linux distros out there. Some for beginners, with a very familiar interface and many applications built-in already. Others are highly customizable and are often used for different types of servers. What they all have in common is the use of a command-line interface for many commands that can make your life easier. Let’s go and explore the 12 basic Linux commands that can really help you!

How to use Linux commands?

To use commands, you will need to open the Terminal application. There you can write the commands and press Enter to execute them. 

You can use the Tab button to finish the text you are typing like “cd Doc” + Tab will get you “cd Documents”

Ctrl and C will stop any running command or Ctrl and Z to force stop it if the first doesn’t work. 

12 Basic Linux commands:

  1. Pwd command. This command will show you in which directory you are. It will show the complete path from the root. It starts with “/” symbol and usually will show you something like “/home/USERNAME…”
  2. Cd command. Change directory. You can write the path to the directory that you want to go. For example, you can type “/home/USERNAME/Downloads” and go to the Downloads directory. If you use just “cd-“, you will get one directory back, just “cd” for home and for one directory up “cd ..”. 
  3. Is command. It will show you what is inside the directory. Use just “is” if you want to see the current directory and “is + patch” for another. With addition “is –R” you see the files from the sub-directories too; “is –a” all including hidden files; “is –al” list of all with details.
  4. Locate command. Just like the search on Windows, there is a way to find files on Linux. Use the locate command like this “locate FILENAME”. If you use it with “locate –i FILENAME” it will ignore letter size. You can use it with “*” symbols like “locate -i *WORD1*WORD2” to search for a file with two words you remember. 
  5. Cp command. Cp – copy. Create an identical copy to another directory. First, you write cp, then the file you want to copy and followed by the directory where the copy will be put “cp puppy.jpg /home/USERNAME/Downloads”.
  6. Mv command. Mv – move. Write mv, then the file name, and last is the directory, where you want to move it to. Example “mv puppy.jpg/home/USERNAME/Downloads”.
  7. Mkdir command. Mkdir – make a directory. Example “mkdir Album” will create a directory called Album. 
  8. Rmdir command. Rmdir – remove a directory. You can use it only if the directory is empty. Example “rmdir Photos”. 
  9. Rm command. Rm – remove. This one will delete the directory and all the files inside. 
  10. Sudo command. Sudo – Superuser do. This is the administrator of the Linux OS. The command gives root permissions, and you can install and modify many things after it. You will need the sudo user and password to use it. 
  11. Ping command. You can use this one to send a ping signal to a host or IP address. It works well for network diagnostics when you want to see if a device is connected and responds properly.  
  12. Man command. Man – manual. It will show you the manual for a command that you are interested in. Example “man ping”. 

These are 12 basic commands that you should know for now. There are many more, but you will start learning them with time. On Linux, you can do everything with the Terminal, and in most cases, it is faster. Learn to use the command-line interface if you really want to master Linux OS. 

Article Writter By


Write a Comment

Your email address will not be published. Required fields are marked *