Introduction
Although you may think that you have learned to master Linux command line with bash shell, there are always some new tricks to learn to make your command line skills more efficient. This article will teach you a few more basic tricks on how to make your life with the Linux command line & bash more bearable and even enjoyable.
Bash Command History Expansion
This section will mostly deal with bash shortcuts in combination with three bash history expansion characters “!”, “^” and “#”. Bash Command History Expansion character “!” indicates start of history expansion. The “^” is a substitution character to modify a previously run command. The last optional character is “#”, which denotes the reminder of the line as a comment.
Repeat last command
$ echo Bash Shortcuts
Bash Shortcuts
$ !!
echo Bash Shortcuts
Bash Shortcuts
!! is probably the easiest and most popular bash shortcut, which simply shows and executes your last entered command.