One of a benefit of pair programming is you got to learn things that you don’t even know you need to learn. When I paired with Mike Mazur, one of the Pivotal Labs1 engineer, I got to learn a very useful trick.
When I want to refer to commands that I’ve used before, I’d do this:
Then I’d cut and paste the result to execute. Not ideal, but it worked for me. Because I didn’t know better.
Until he showed me the right way of doing it. Comes reverse-i-search. All you need to do is press
ctrl + r in terminal and start typing the command you want to search for. For example, I want to search for
If that’s not the command you looking for, just keep tapping
ctrl + r until you find the right one. Then just press
enter to execute. Handy!
Also, it would be better if you increase your history size. Just add these lines to your profile file, one of those
The size is up to you, I got those values from lifehacker.