LWN.net Logo

CLI Magic: Using command history in the bash shell (Linux.com)

CLI Magic: Using command history in the bash shell (Linux.com)

Posted Jul 4, 2006 9:28 UTC (Tue) by gip (subscriber, #20897)
In reply to: CLI Magic: Using command history in the bash shell (Linux.com) by sveinrn
Parent article: CLI Magic: Using command history in the bash shell (Linux.com)

Quote:
I want to be able to type "mount<up><up><up>" and get back the command I want.

Yes, I had this when I used 4DOS and liked it so I set up bash to do the same thing (it's a "readline" capability, I think).

Create a .inputrc file in your root and put in

"\e[5~": history-search-backward
"\e[6~": history-search-forward

Or whatever your PgUp and PgDn keys output. Next login it should work.
other stuff I use in .inputrc

"\e[2~": kill-whole-line
"\e[3;2~": kill-line

So Ins clears the line and SHIFT-Del clears from the cursor to the end

Hope this helps.

Ciao
G


(Log in to post comments)

CLI Magic: Using command history in the bash shell (Linux.com)

Posted Jul 7, 2006 10:39 UTC (Fri) by ekj (subscriber, #1524) [Link]

For many cases, typing C-r mount and then repeatedly C-r until you find the correct one is equally simple.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds