searching through the history of commands you ran in terminal

Whenever I am logged in to a server or even when I am working on my own machine, I keep searching through the command history through up and down arrows.

While this can be efficient if you have 2-3 commands, it can be quite frustrating to find specific commands.

That is something I keep doing over and over again, and now I have a better way, I just grep through the list of commands, find the one I want, copy it and paste it into a new command, and I’m done.

This saves me a lot of time.

Here’s how:

To show the history of commands you just do:

1
history

You probably know the rest, but you can just pipe the history into grep and search your history

1
history | grep {command_or_part_of_command}

For example:

1
history | grep cp -R

Enjoy!

Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com