Skip to content

Comment on Time-saving tips for Linux

Comments

"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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.