How to search for a previously used command in linux

From the command line type
history | grep whatever

From a console try Ctrl-R and then start typing the first few letters of the command hit enter when you find what you are looking for.

This saves time and is a great reminder if you forgot a long command string. Typing history will bring up a list of your previously used commands too so you can export them or review what it was you just done to break whatever it was you just broke.


linux-history

Leave a Reply

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