1 comments
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
historyYou 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 -REnjoy!
1
Comments
you can always hit
11:04 Aug 14th
you can always hit Ctrl+r(reverse-i-search) and start typing previously entered commands.
