10 Bash Tricks Every User Should Know About

In this article I will show my favourite bash tricks. Because I am very lazy, I adore all the dirty tricks that can make my bash usage easier.

Watch Free Movies

1-2 : The PATH and the CDPATH.

The PATH and CDPATH are very usefull. Setting all the directories containing important scripts or basic commands in the PATH makes your life easier. Also, add to the CDPATH the directories you use the most. Read more about the PATH (here) and the CDPATH (here).

3. The Reverse-i-Search bash feature. Instead of searching desprate in the history, you can use the Reverse-i-Search, for a faster result. Read more about the Reverse-i-Search (here).

4-5. The TAB-TAB and Case Insensitive Completion are also two usefull tricks.
Having the TAB-TAB feature activated, you will get all the matching posibilities when pressing TAB. By default, you have to press TAB twice to get this. Also, if you want to get a case insensitive tab completion, activate the Case Insensitive Completion. Read more about these two features (here).

6. Also, I like to CD into directories only by typing the directory names. Read more about these (here).

7. The wildcards are life saving characters. Being able to use them correctly can make your work easier. Read the wildcard articles (here).

8. The !! command is used when needing to repeat the previous command. I ofen use it prefixed with sudo, when I forget that I need super-user priviledges to do some administrative task. Read more about the !! trick (here).

9. The Bash has its own shortcuts for coping, pasting, cutting text or moving the coursor. To learn how to use this shortcuts efficiently, read this article (here).

10. Setting your favourite text editor as default is usefull. The first thing I do when I reinstall the system, is to replace the nano/pico editor with vim, as the default text editor. Read how to change the text editor (here).

Scroll to Top