[wplug] smart command history?

Bryon Gill bgtrio at yahoo.com
Tue Feb 24 18:23:56 EST 2004


This may be your lucky day.

Start typing a command in bash, then type Ctrl+r .  You'll get the most 
recent command in your bash history that matches the command you've typed.  
Invoking Ctrl+r again gives you the next most recent match, and so on.

I use this ALL the time.  Can't live without it.

Bryon

On Tue, 24 Feb 2004, Brandon Kuczenski wrote:

> So everyone knows one can select from previously-entered commands by 
> pressing up-arrow in a terminal.  And tab-completion can help one fill out 
> a partially typed command.  I was wondering if anyone was familiar with 
> 'Matlab-style' command history for a *sh terminal.  The way Matlab does it 
> is: if you have a partially typed command, then up-arrow will only fill-in
> previously-entered commands that match the partially-typed string.  For 
> example, if one had entered a command like 'chmod a-w *' and then entered 
> some other commands, navigating around and such, then if the one entered 
> 'ch' and pressed up-arrow, it would cycle through only commands beginning 
> with 'ch', rather than all recently-entered commands.
> 
> One can imagine how this would be useful.
> 
> I could imagine a way to do this by searching through the .bash_history 
> file, but I think that file only gets written to on logout. Besides, I 
> wouldn't know how to hook it into bash.
> 
> -Brandon
> 
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
> 




More information about the wplug mailing list