The "History" Command?
I recall my old work colleague show me a history command that allows you to search the history for all commands that started with lets say "wget" or whatever you're looking for rather than everything in your history cache. I attempted a Google search and could not find anything that shows me how to refine the history search.
Anyone know what I am looking for? |
grep?
It works like this: cat ~/.bash_history | grep wget |
Quote:
Either way, it appears the results are the same... |
You also might check out the event designator "!", which lets you quickly print (with or without executing) the most recent command that starts with a certain string.
Contrived example: Code:
[fugu ~]$ history In any case, that still doesn't sound like quite what you're looking for; check out the extensive manpages for bash(1). There's a good sized section on history and related topics there. |
Use CTRL+R
Use the above combination of the keys to search for a string.. very helpful indeed.
|
I see smehra24 has already answered.
Just use EMACS commands. What you want is Code:
Ctrl-R wget Look in "info bash" for more info. |
All times are GMT -5. The time now is 11:44 PM. |