How to learn the Linux terminal and basic commands from scratch

Who I am
Marie-Ange Demory
@marie-angedemory
Author and references

Basic Linux commands

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

  • pwd: it is used to locate the path of the folder in which you are currently working. In fact, running this command will return a full path, that is, a path to most directories starting with the forward slash "/"
  • CD: this command is for browse directories and documents operating system. When you enter it, you will need to specify the full path depending on which directory you are in. For example, if you want to go to a new directory whose directory is “/ home / username / foldername”, then you have to 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 paths, type "IS" followed by the directory you wish to visit.



  • cat: this command is undoubtedly one of the most used in the Linux operating system, as it helps us to make a list of the contents of a file or document on standard output. To run it, you just have to type “Cat” together with the file name and its respective extension.
  • cp: in case it is necessary copy files from one directory to another, you need to use this command. For example we have that the command “cp scenario.jpg / home / username / videos” will create a copy of “scenario.jpg” from the current directory in the video directory.
  • mv:  normally this command is used to move documents and files, however it is also used to rename files in Linux.

Other Linux commands you should know

  • 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 case you need to create a directory within another directory, you need to write the command as follows “mkdir Images / Newfile.
  • rmdir:  now, if you want to delete a directory, you need to enter this command, but you can only delete empty directories.
  • rm: this command is used to delete directories along with the content that is inside. If you want to delete only the directory, you have to use the command “Rm-r”. Also, we remind you that the directory deleted with this command cannot be recovered.
  • touch: just in case you want create a new blank file, you can do this by entering this Linux command. For example, to create an HTML file in the documents directory, type "/home/username/Documentos/Web.html"



  • Find- 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 it easy to find the file.
  • Find command: it is very similar to the locate command, as it also helps us find files and directories. However, with the find command we can locate files located in a specific directory.
  • Grep: with this wonderful command you can search for a specific file through text.
  • Sudo: is an abbreviation of the command "SuperUser Do" and helps us to run processes that ask us for root permissions. We advise you not to use this command every day, as you can make irreparable errors in your terminal.
TagsLinux
add a comment of How to learn the Linux terminal and basic commands from scratch
Comment sent successfully! We will review it in the next few hours.