Getting used to the Terminal can be a pain, but these tips should make life with the terminal easier if not better than your GUI experience.
Note: Some of these tips may not work depending on the Linux distribution or shell you are using.
Autocomplete can really save you some time, in the terminal. Just type the beginning of the command, then hit the Tab key to autocomplete.
It’s all so useful in viewing available commands. For example, if you type “who” and then hit the tab key two times you can see all the commands that start with “who”.
2. Terminal Command History
Sometimes you just need to use a command you already use before. Pushing the up arrow key ￪ or down arrow key ￬ will allow you to browse your command history.
Another useful method of searching history is to use reverse search on the terminal. push Ctrl+r at the terminal and a search function will appear.
3. Bang Bang (!!)
There are going to be times when you’re typing long commands only to forget something at the start (normally
sudo). Bang Bang(
!!) gets replaces with the previous command you typed. For example say you use “
apt update” and forgot the
sudo in the front. You can use Bang Bang and type “
sudo !!” This isn’t any different than typing “
sudo apt update“. This nice shortcut will save the frustration of going back, and typing it out again.
4. Ctrl+C – Stop/Kill/interrupt command key.
Sometimes there’s going to be a command want to stop. One way to stop a command while it’s running, is to use the interrupt command Ctrl+C.