Bind up/down arrow key to BASH history-search

| | Comments (0)

在 ~/.bashrc 或 /etc/bashrc 加入以下兩行
bind '"\x1b\x5b\x41":history-search-backward'
bind '"\x1b\x5b\x42":history-search-forward'
這樣就可以鍵入 command prefix + 上下鍵做 history search, 很方便.
感謝 zxvc 提供
ref. [心得] 好用的bash history function

Leave a comment

March 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Pank published on February 4, 2007 1:03 AM.

Windows Live Messenger 8.1 Final was the previous entry in this blog.

Wireshark 0.99.5 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.