bash has some nice features which can speed up one's workflow if correctly used. I will use this page to list some tricks I use.
Modes
Change mode to vi : set -o vi. As I used to use vi editing mode, I will only provide tips in this editing mode. These tips are avilaible under emacs editing mode set -o emacs. Use google to find the key strokes.
Tips & Tricks
Like vi, bash has two command line modes : edit and command. To switch from edit to command mode, use ESC key.
/ and ? will start forward and backward search in the history. Once in search mode, type a word, then press Enter. n and N can be used for backward and forward search.
!! : will recall the last typed command. This is useful to prefix the last type command with another command. For example, if rm /path/to/file is typed, but then root privileges is required, sudo !! will do the trick.
!!:p will just print the previous command
!:N : will allow reuse the Nth argument from the previous command line.
Ex: if echo t1 t2 t3 is typed, then cat !:2, is equivalent to cat t2.
!$ is use last parameter of the previous command. Using the previous example, cat !$ is the same as cat !:3.
!^ refers to the first parameter
!* refers to whole command line parameters.
!CMD:N : allows to recall N the parameter used by the command CMD
:h and :t allow to reuse the directory and filename part of parameters.
Ex: Consider the command ls /etc/systemd/system.conf. In this case
ls !$:h is same as typing ls /etc/systemd/
ls !$:t is same as typing ls system.conf.