Tip to improve bash history

Bret Hughes bhughes at elevating.com
Mon Nov 17 22:47:16 UTC 2003


On Mon, 2003-11-17 at 16:30, Jimbo wrote:
> Dont for get good old ctrl r
> 

I have read an reread the bash ma page trying to figure out how to use
history searches but I guess I am too stupid to figure it out.  Maybe I
will try the tip originally suggested.

Bret



> On Monday 17 November 2003 20:51, Jaap A. Haitsma wrote:
> > Already wanted this feature for ages, now finally discovered how you can
> > get it to work in bash.
> >
> > Let's say you have the typed following history in bash
> >
> > info gcc
> > make
> > vi main.c
> > make
> > vi Makefile
> >
> >
> > Now you want to issue another "info gcc". You could press the up arrow
> > four times but if you bind the <up arrow> to "history-search-backward"
> > instead of "previous-history" you can type the first characters of the
> > line you want to repeat and then push the <up arrow>. In this case you
> > would type i <up arrow> and bash already presents you with the "info
> > gcc" line. "history-search-backward" and "history-search-forward" only
> > show you the history entries which match with the character you already
> > typed. If you do not type anything it just works like the normal
> > history.
> >
> > To get this behaviour always add the following two lines to your
> > /etc/inputrc
> >
> > "\M-[A":history-search-backward
> > "\M-[B":history-search-forward
> >
> > Have fun with it
> >
> > Jaap
> >
> >
> >
> > --
> > fedora-list mailing list
> > fedora-list at redhat.com
> > http://www.redhat.com/mailman/listinfo/fedora-list
> 
> 
> --
> fedora-list mailing list
> fedora-list at redhat.com
> http://www.redhat.com/mailman/listinfo/fedora-list






More information about the fedora-list mailing list