Archive for the ‘bash’ Tag

bash tip: what was that command?

Can’t remember that great command you used a couple days ago?

Try this:
ian@linux:~# history | grep "command"

Substitute “command” with any part of it you still remember. You’ll get a list of everything in your command history that includes that bit of text, and the command you’re looking for should be in there somewhere.

If I run `history | grep tee', I get:

1837 man tee
2383 history | grep tee

Then I can run `man tee' again by typing `!1837'