On Sat, Mar 21, 2009 at 01:16:12PM EDT, Ken Irving wrote: > This sounds a lot like what you get with the reverse-search-history > command, bound to control-r (C-r), a great feature indeed.
Priceless. I had posted the following obfuscated explanation a couple of hours ago but since I was subscribed under a different address, it never made it to the list. :-( ____________________________________________________________________ Maybe it's because I'm used to it.. but <CTRL-R> seems to do pretty much what you're after and with less effort: Say, you ran the following command: $ xset dpms force suspend To retrieve this command later in the day: <CTRL-R> + "sus" # or other such as "ce s" etc. Displays: (reverse-i-search)`sus': xset dpms force suspend <CTRL-E> # or <CTRL-A> etc. $ xset dpms force suspend <Enter> Naturally, if typing "sus" (or other) retrieves a different command, you would have to either type an extra character such as "p" (the search back in the history is incremental) or issue a second <CTRL-R> but with a bit of practice, you pretty soon get used to finding short strings that will hit on the exact command that you are looking for. Where it works "better" for me than what you suggest is that you don't have to visually scan an excerpt of the history to locate the command that you were looking for: either you find what you're looking for the first time around or successive <CTRL-R> actions bring back successive hits one at a time, which I personally think is more efficient. Another useful aspect of "reverse-search-history" is that you are not limited to searching on the command name, which makes it easier for me at least to select a search argument that will bring back the precise entry that I am looking for especially for commands that I typically issue dozens of times in any bash session. i.e. it's probably more effective to look for, say "less /var/log/messages" via a "<CTRL-R> sag" or "<CTRL-R g/m" than "<CTRL-R> less". Sorry for the lenghty explanation, stuff like that can be demo'ed in a couple of keystrokes but takes forever to describe in plain English. ____________________________________________________________________ CJ