Hello people! Today we are going to quickly show you basic tricks and commands for the terminal in GNU / Linux.
Open the terminal
Open the application menu and find the terminal application. You can also open the terminal by pressing Ctrl + Alt + T.
Run a command
Type the command and press the ENTER key.
Close or leave the terminal
Run the command exit
Stop the execution of a command
To stop executing a command, either because it is taking too long or because it hangs up, press Ctrl + C.
We can autocomplete by pressing the TAB key either to finish typing a command or to show us what options are available.
Complete the command
Show commands that start with ...
Complete folder addresses
Show available parameters for a command
Show package names starting with ...
Folder (directory) navigation
Show the contents of a directory.
Show list details
Show hidden files and folders
Parameters can be combined to display the details list including hidden files.
In GNU / Linux to convert a file into a hidden file, just make the name start with a period, the same applies to folders.
Getting in and out of folders
Enter a folder
Exit a folder
Show full path of current folder
See text file
Show a text file
With less you can search for a word in the text
- Search: / + word + ENTER
- Find Next: N
- Find Previous: Shift + N
To get out of less press the Q
The command man shows the command manual
man use the same navigation and search as less. To exit press the Q key.
See the file type
The file command displays the file type regardless of whether the extension has been changed or has no extension.
Edit text files
nano is a simple, easy-to-use text editor for the terminal, at least much easier to use than I saw.
Use the arrow keys to scroll through the text. To exit press the Ctrl + X keys, then you will be asked if you want to save the changes.
In the menu the symbol «^» is replaced by the Ctrl key, in this way
^ X = Ctrl + X
This is sufficient for terminal newbies, at least for a little while. The terminal is a powerful and light tool, little by little more and more commands are memorized, until you acquire such comfort that one prefers to perform many tasks in the terminal over doing it in a graphical interface. I hope this article is helpful and facilitates the introduction to the use of the terminal to the newest in the world of GNU / Linux.
Create empty file
Another way to restart
sudo shutdown -r now
To turn off
sudo shutdown -P now
Off at 02:30 pm
sudo shutdown -P 14:30
Off in 30 minutes
sudo shutdown -P +30
watch -n [segundos] [comando]
watch run the command every few seconds, to stop watch press Ctrl + X.
watch -n 1 date
watch -n 10 df -h /dev/sda1