User Tools

Site Tools



See also the Bash Configuration page.

Searching the Command History

Incremental searching

Incremental means the search begins before the searcher has finished typing the string to search for. Bash supports this feature with the Incremental Backwards Search (C-r), and the Incremental Forward Search (C-s).

Search on

Through repeatedly typing C-r or C-s, older (newer) matching entries are shown and so can be searched through.

There are several posibilities to finish searching:

  • if the found entry matches completely, it can be executed by hitting Return
  • if it matches only partially, C-j can be pressed to finish the search and allow editing the entry (try this one: C-j C-x C-e)
  • if the entry was not found, the search can be aborted using C-g. This also restores the original content of the commandline, which may contain parts of the string to search for.

NB: the amount of 1337'nes increases from top to bottom!


''forward-search-history'' and ''stty''

Normally, C-s should activate the Incremental Forward Search. But in nearly every case this leads to a hanging terminal. This comes from stty interpreting C-s as stop-signal.

To recover the terminal from this state, a simple C-q should suffice.

system/shells/bash.txt · Last modified: 2015/11/12 13:04 by phil