Clearly the terminal is a tool that every Linux user should use at some point, are not exempt from it. Although it is not a mandatory tool to use, it is still a great fear for newcomers to Linux.
It is therefore so I share some of the most basic commands that users in the terminal and that you can learn as something additional to your Linux experience. These commands are a mere compilation of the most common that you will be able to use.
Sudo
This is the most important command of all, since every command that requires root permission needs this sudo command.
Its mode of use is that must be used before each command that requires root permissions.
For example, to get super user permissions:
sudo su
CD
This command It is basic because it is the one you use to change the directory, its use is very easy. Just type in the name of the folder you want to access from your current directory.
Example, I am in my personal folder and I want to access my Downloads folder
cd Descargas
If I want to go back to the previous directory I just add ...
cd ..
LS
This command It is linked to cd, because with ls you can list all the files and folders contained within the directory where you are positioned and it is not limited to that but you can also list those of other folders without having to be inside them.
Example, I want to see what folders make up my personal folder so I just write
ls
And I will receive the list within the directory where I am located:
Descargas
Documentos
Imágenes
Juegos
Now if I want to see what is inside other directories, for example, what is inside my documents folder and I know that there is a folder called project and I want to see its content:
ls /Documentos/proyecto
mkdir
With this command we have the possibility to create directories either in the directory where we are positioned or in some other, we just have to define the path.
Example, I want to create the folder with name 1 and another that is inside it that has the name 2
mkdir 1
mkdir /1/2
touch
Similar to the previous one only this allows us to create an empty fileIn the same way, this is done in the current directory or in the path that we indicate.
Example, I want to create a text file:
touch archivo.txt
CP
Copying and pasting is the important task we must do to organize our files. Using cp will help you to copy and paste the file from the terminal. First, we must determine the file we want to copy and enter the destination location to paste the file.
Here it is important to indicate which file or folder will be copied as well as the path where the copy will be placed.
cp origen destino
RM
This is a command to delete files and directories. You can use -f if the file needs root permission to be removed. And you can also use -r to do recursive delete to delete your folder.
It is important, very important to pay close attention to the use of this command since as you can define routes, you can terminal deleting important folders from your system.
Example:
rm myfile.txt
CAT
As a user, you often need to see some of the text or code of your script. Well, this basic Linux command will show you the text inside its file. This command goes hand in hand with ls as you can explore what the files you list with ls contain.
Example, I want to see what the Lists.txt file contains
cat Lists.txt
power-off
And the last command is for system shutdown. Sometimes they need to disconnect directly from their terminal. This command will do the homework.
Example
poweroff
Without further ado you can know each command and the parameters that can help you improve the use of each of these, we only add –help to these.
In my humble opinion, the MAN command is much more important than SUDO since even if we do not have internet, at least we can know the manual of the commands and documentation of the system that will be of great help to be able to use it.
Regards!!!