Re: Tip to improve bash history
Bret Hughes <[email protected]> 17 Nov 2003 16:47:16 -0600
| Newsgroups | gmane.linux.redhat.rhl.general,gmane.linux.redhat.fedora.general |
|---|---|
| Message-ID | <1069109244.16704.203.camel@bretsony> |
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 > > [email protected] > > http://www.redhat.com/mailman/listinfo/fedora-list > > > -- > fedora-list mailing list > [email protected] > http://www.redhat.com/mailman/listinfo/fedora-list -- fedora-list mailing list [email protected] http://www.redhat.com/mailman/listinfo/fedora-list