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.
autocomplete
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.
ls
Show list details
ls -l
Show hidden files and folders
ls -a
Parameters can be combined to display the details list including hidden files.
ls -la
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
cd carpeta
Exit a folder
cd ..
Show full path of current folder
pwd
See text file
Show a text file
less archivo
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
Manuals commands
The command man shows the command manual
man [comando]
man ls
man cd
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.
file archivo
Edit text files
nano is a simple, easy-to-use text editor for the terminal, at least much easier to use than I saw.
nano archivo
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.
bonus
Create empty file
touch archivo_nuevo.txt
Restart
sudo reboot
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
Monitor command
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
Thanks for the information, very useful.
Thank you very much for contributing to the community. Because the world of the terminal is vast, we have moved to a sub-category dedicated to it: «Using the terminal«. We hope you like it and learn from other Linux savvy.
Excellent manual, thank you.
Very good contribution and thanks for thinking of us newbies
Very interesting article
Isaías Gätjens M, Straight to the point but clear.
Excellent informative contribution, a world is grateful for the effort made for us newbies. Thank you!!!
Good afternoon
Very useful
Thank you
Excellent contribution. I have a hard time understanding the commands, but I practice a lot to understand them. Thank you.
Hello I hope you are well, I want to know how I can use the terminal, when it asks me for the password, it is not written for anything in the world and I do not understand why you can help me with that.
I recommend that you review this article.
https: //deepinenespañol.org/terminal-para-novatos-el-comando-sudo/
muchas gracias, tomando nota, saludos!!