|Summary help replacing me|
|Improving readline over its default capabilities.|
Readline is a library by the GNU Project, used by Bash and other CLI-interface programs to edit and interact with the command line. Before reading this page please refer to the library home page as only subtle configuration will be introduced here.
Usually, pressing the up arrow key will cause the last command to be shown regardless of what has been typed so far. However, users may find it more practical to list only past commands that match the current input.
For example, if the user has typed the following commands:
In this situation, when typing Template:Codeline and pressing the up arrow key, current input will be replaced with Template:Codeline, the last performed command. Had history search been enabled, only past commands beginning with Template:Codeline (the current input) would've been shown, in this case Template:Codeline.
Alternatively, one can use reverse-search-history (incremental search) by pressing Template:Keypress+Template:Keypress, which does not search based on previous input but instead jumps backwards in the history buffer as commands are typed in a search term. Pressing Template:Keypress+Template:Keypress again during this mode will display the previous line in the buffer that matches the current search term, while pressing Template:Keypress+Template:Keypress (abort) will cancel the search and restore the current input line. So in order to search through all previous Template:Codeline commands, press Template:Keypress+Template:Keypress, type 'mount' and keep pressing Template:Keypress+Template:Keypress until the desired line is found.
The forward equivalent to this mode is called forward-search-history and is bound to Template:Keypress+Template:Keypress by default. Beware that most terminals override Template:Keypress+Template:Keypress to suspend execution until Template:Keypress+Template:Keypress is entered. (This is called XON/XOFF flow control). For activating forward-search-history, either disable flow control by issuing:
$ stty -ixon
If you repeat the same command several times, they will all be appended in your history. To prevent this, add to your Template:Filename:
To disable logging blank commands add this to your Template:Filename:
If your Template:Filename already contains
replace it with