Basic Linux Commands

If you want to learn how to use an operating system other than Windows or iOS, then we recommend that you take a look at Linux, since it is the most used by programmers. Later we will show you a guide so that you can learn to use the terminal and basic Linux commands from scratch.

When using this operating system, you have to make use of the console. Through this you will have access to the different services and functions of Linux. You simply have to know what commands you must enter in the console to be able to complete all the tasks that you require. Here we will show you some of the most common Linux commands.

Basic Linux Commands

In this section we will talk to you in great detail about the basic Linux commands that you need to know to learn how to use the terminal without problems. At first it may be difficult for you to learn them, but after a few days you will be able to learn them.

  • pwd: used to locate the path of the folder you are currently working in. In fact, executing this command will return a full path, that is, a path to most directories that start with the forward slash “/”
  • cd: this command is used to navigate between the operating system directories and documents . When entering it, you will have to specify the full path depending on the directory in which you are located. For example, if you want to go to a new directory whose directory is “/ home / username / foldername”, then you must write cd accompanied by this path.
  • is: It is useful to keep an eye on the contents of a directory, in fact, this command will show the contents of the current job by default. Now, if you want to see the content of other routes, then type “Is” followed by the directory you want to visit.
  • cat: undoubtedly this command is one of the most used in the Linux operating system, since it helps us to make a list of the content of a file or document on standard output. To run it, you just have to type “cat” along with the file name and its respective extension.
  • cp: in case you need to copy files from one directory to another , then you must use this command. As an example we have that the command «cp stage.jpg / home / username / videos» will create a copy of «stage.jpg» from the current directory in the videos directory.
  • mv:  normally this command is used to move documents and files, however it is also used to rename files in Linux .

More Linux commands to keep in mind

  • mkdir: it  is used to create a new directory , for example if we write “mkdir Images”, a directory called music will be created immediately. In the case that you need to create a directory within another directory, you must write the command as follows «mkdir Images / New file.
  • rmdir:  now, if you want to delete a directory, then you have to enter this command, but you can only delete directories that are empty.
  • rm: this command is used to delete directories along with the content that is inside. If you want to delete the directory only, then you have to use the command “rm -r” . Also, we remind you that the directory deleted with this command cannot be recovered.
  • touch: in case you want to create a new blank file , you can do so by entering this Linux command. For example, to create an HTML file in the documents directory, type “/home/username/Documents/Web.html”
  • Locate : this command is used to locate a file, just like the search command in Windows. In fact, if you add the “-i” argument to this command, we will remove the distinction between uppercase and lowercase letters, which makes finding the file easy.
  • Find command: it is very similar to the locate command, since it also helps us to find files and directories . However, with the find command we can locate files that are in a specific directory.
  • Grep: with this wonderful command you can search for a specific file through the text.
  • Sudo: it is an abbreviation of the command «SuperUser Do» and it helps us to carry out processes that ask us for root permissions . We recommend that you do not use this command daily, as you can make irreparable errors in your terminal.


Leave a Comment