Bash history

Combine the grep and history commands in the bash shell to retrieve a custom list of previously entered commands:
history | grep 'my search string'
That will print out a list of commands. Each command has a number that you can use to call the command again. So, if the command you want is numbered 1234, then you can issue the following command and execute it again (just put a ! in front of the number):
!1234

Article Type

General