March 1, 2024

Get More Out Of Your Linux Terminal With Theses Tips

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.

1. Autocomplete


Autocomplete can really save you some time, in the terminal. Just type the beginning of the command, then hit the Tab key to autocomplete.

$ touch
Then hit the tab key to autocomplete.
$ tou
write the few first letters.

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”.

Hitting tab two times
Even works with directory’s or files.

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.

Up and down keys at the terminal.

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.

Control+R
Just start typing the few first letters, and it will find and autocomplete as you type. just hit enter once you see the command you want.

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.

Example of Bang Bang

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.

A command you want to stop.
Using Ctrl+C interrupt the command that’s running

colby

Computer guru with years working with technology. I find it fun to tinker with computer new and old, and make them do my work for me.

View all posts by colby →

Leave a Reply

Your email address will not be published. Required fields are marked *