Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"In bash, use Ctrl-R to search through command history."

Or, add these lines to your .bashrc to use Ctrl-p and Ctrl-n:

bind "\C-p":history-search-backward

bind "\C-n":history-search-forward



Why? C-r and C-s already do each of these, and C-p and C-n are for going back and forward in history. (Personally, I use M-p and M-n so that bash in the terminal works like Emacs.)


Doessn't that just do the same thing as the built-in Ctrl-r and Ctrl-s? Also, Ctrl-p and Ctrl-n are already used to cycle through previous commands.


You usually can't use C-s because it's bound to stop.

$ stty stop undef




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: