Hello My friends,
Not sure if you were aware of this great bash function that I use daily in my job as a linux systems administrator.
This is called "Reverse I Search" this is tremendously useful when a system administrator needs to search for a previously typed command.
e.g.
About an hour ago I typed a command on my mac book pro into my bash terminal. This command was a difficult command to remember that cleared cache on the system.
Code:
excalibur:~ jasonralph$ dscacheutil -flushcache
Now I have typed about 25 other commands since I typed the command above. I know need this command again, and I can't remember the spelling or command name. However I remember that the command started with dsc.
From the terminal I hold ctrl and r. This invokes the reverse search. Next I type the letters that I remember from the command "dsc". Bash will automatically display the command.
Code:
excalibur:~ jasonralph$
(reverse-i-search)`dsc': dscacheutil -flushcache
Now press enter to execute the command that the search has found.
Have fun and hope this helps.
Jaysunn