Each of us had to use the command line at least once. Some do it with udovolstie, others with apprehension. As promoting the use of the Terminal, I would like to tell you about an interesting team for every day. It's about downloading files, viewing directories, complete the process by the template creating new files on the fly and a few other things.
1. Download files from the web with detailed statistics
Download any file from the Internet, use the command curl. At the same time, at boot time, we will see not only information about the connection speed, but also the elapsed and remaining time, completion percentage and the average download speed. Narimer, download the firmware for the iPhone Apple's servers for this, trying to drive the following command:
curl -O http://appldnld.apple.com/iOS7/091-9495.20130918.FuFu4/iPhone5,1_7.0_11A465_Restore.ipsw
The file will be saved in your home directory, if you want to change the location, use the key -L katalog_dlya_sohraneniya. Please note that you need to use the full URL-address.
2. Advanced directory browsing
Want to see a list of files in a directory indicating the rights of the owner, size, and last modified date? No problems. Go to the desired folder (Command cd ) And trying to drive the familiar lsBut with the key -thor.ls -thor
It is very easy to remember, because once an association with the mythological Thor.
3. Completion of several processes on a template
It happens that you need to nail down some processes of application. For this we have to individually complete their "monitoring system". If you specify in the search bar the name of the program - will be a little more comfortable, but still close them in one fell swoop will not work. You can greatly simplify your task by using the command pkill the pattern. To do this, enter the command as a template and specify the name of the process or the first few letters. For example:pkill Chrome *
All processes in their name «Chrome» will instantly zversheny. Be careful and point out a few more characters to filter out other processes with the same name. Otherwise, there is a chance to complete the other applications and to lose unsaved data.
4. Repeat last entered Terminal command with root
Sometimes we forget that in order to perform certain commands need root access, introduce a long way in the file, and in return we get a message to repeat the command as root. To avoid typing in the command and the path again, you can use the command:sudo !!
After it is necessary to drive the input password and the previous command is executed as root.
5. Search recent commands, without the performance of their
List recently executed in the terminal commands is available by pressing the keys "up". They are convenient to use, if you entered the correct command recently. Flipping 50 or 100 most recent commands do not want anyone. And do not need. To find a particular command with the last entry, simply enter ! first and : p at the end of the command. For example, I want to find the last command execution sudoFor this drive in the terminal:! Sudo: p
Conclusions The results show the last occurrence of the specified command.
6. Create an empty file or files on the fly
The touch command, useful when you need to quickly create a new file. It is very easy to use, and easy to remember. Try it yourself:touch filename
If you just add the name of the file extension - the corresponding file will be created. For example, for the text file, enter:touch filename
Also, you can simultaneously create multiple files with different types. For example:touch Dokument.doc Tablitsa.xls Bloknot.txt
The result will be the creation of the current directory three files with the specified extensions.
As you can see, using the Terminal, we can pretty much. Do not forget about the existence of this tool and use it often!
* * *
Additions from our readers.
Leonid Efremov, tells about a reverse search, the essence of which is that when you type the first characters of a command, the system will try to guess which team you want to enter. Something like a live Google search. To enable it, click in the terminal ctrl + r. In this case, instead of the user's login will be displayed (Reverse-i-search) ` ':