If Linux is still considered a system for geeks it is probably because historical users of this operating system love to use the Terminal. That is the terminal through which it is possible to send commands to the system from the command line, without going through the graphical interface. In fact, to use the Linux terminal, it is necessary to know the commands which are dozens and dozens in number.
Those who know all the Linux Terminal commands well have nothing less than superpowers on their computer: they can really do anything, sometimes even things that are more difficult and cumbersome through the graphical interface.
For those who are approaching the Linux terminal for the first time, here is a short list of basic commands (in strict alphabetical order) to start tasting the potential of the command line.
Have an old PC/laptop that is really slow and hampers your progress? Then, the product you need is Xtra PC, a small but efficient flash drive that bypass your slow OS and replaces it with a super-fast Linux distribution. This XtraPC review will tell you everything about this useful USB.
Linux commands: cd
The “cd” command stands for “change directory” and is used to change and move from one folder to another in the file system. Using it is very simple: just type “cd + folder name” and press enter. It is usually used sequentially: you enter a folder and immediately afterwards into another, contained in the first. But it is possible, if you know the exact path of the folder where you want to place yourself, type it after the cd command. For example, by running the command ” cd / usr / local / bin ” we will end up directly in the desired folder, regardless of which one we start from.
Linux commands: curl
The “curl” command is used to get information about a Web page and to reach files hosted on the network. Let’s say we want to retrieve a file from GitHub (the most used hosting service for publishing Linux applications). If we know the exact address of that file we can type “curl https://raw.githubusercontent.com/XXX/YYY/ZZZ” to reach that file. If we do not add anything else to the curl command, we will only get information on the file in question, while to save it on our computer we will have to add the “-o” option at the end of the command.
Linux commands: df
The “df” command is very useful to get information about the file system used on the computer. Through this command we can know the size, used space and free space of the partition expressed in bytes. If we add the option “-h”, which stands for “human readable” that is “readable by humans”, then this information will be displayed in MB or GB.
Linux commands: find
The “find” command is very useful if we can’t find a file. If we remember the name of the file the find command will find it for us by showing us in which folder it is contained. You can also use it to search for files that contain some letters we specify in the name. For example, if we run “find -name *ones*” we will be shown all the files whose name contains “ones”: from “honest.txt” to “rolling stones.mp3”. If we add the option “-type f” we will limit the search to files only and we will not be shown the folders containing “ones” (for example: / ramones).
Linux commands: kill
“Kill” is a command that does what it promises: it kills processes that have crashed. Or rather: it ends the processes that we ask it to close, usually when they are blocked or are creating problems with the PC. To tell kill which process to kill we must first find its “process ID” (PID), i.e. the number that identifies that process. To do this we will have to run, before kill, the command “ps -e | grep processname” and receive the PID number. Let’s pretend that the PID is 1234, to end the 1234 process we will have to issue the command “kill 1234”.
Linux commands: mkdir
On Linux the “mkdir” command is used to create a directory, then a new folder in which we can insert files. It is used more or less like the previous “cd”, so we can either send the command “mkdir invoices” and then move into the new folder (with “cd invoices”) and create the folder 2019 (with ” mkdir 2019 “) or run directly the command “mkdir invoices / 2019”.
Linux commands: mv
The “mv” command stands for “move” and is used to move files between folders, but also allows you to rename them. This command should be used indicating the path of origin of the file we want to move and the one where we want to move it. For example: “mv /musica/ukulele/traccia1.mp3 /musica/chitarra/traccia1.mp3”. We can also rename the file as we move it: “mv /musica/ukulele/traccia1.mp3 /musica/gitarra/nuova-traccia1.mp3 “.
Linux commands: shutdown
The “shutdown” command also does what the name promises: it shuts down or reboots the operating system. If we use it without options this command proceeds to shut down the PC in a minute, while if we add the “now” option it shuts it down immediately. It is also possible to enter a precise time to program the deferred shutdown of our machine.
Linux commands: ssh
The “ssh” command is used to connect to a remote computer and log in with your account. To establish the connection, you need to know the IP address of the second PC and specify the name of the account we want to access. For example: “ssh [email protected]”. If we have entered the correct address, we will be asked for the password to access that computer with that account.
Linux commands: sudo
The “sudo” command is a bit strange compared to the others seen so far, because it is a command that is used to execute others. To be precise, to execute commands that require root (or superuser) permissions. For example, the command “passwd”, which is used to change the password of an account, cannot be used if it is not preceded by sudo: “sudo passwd mario” will allow us to change the password of Mario’s account, even if we are not Mario.
Conclusion
To make the most of Linux features, you need to know some Terminal commands. Mentioned above are the most important ones.