Ben Sturmfels

Search forward is Bash history

Ben Sturmfels at

Wee! I've wondered about this for years. Ctrl-r [phrase] finds the last matching command in your Bash history, and pressing Ctrl-r again goes further back. But often you go one too far. Turns out Ctrl-s takes you forward again, but that keybinding doesn't usually work because with XON/XOFF flow control. You can fix this by putting stty -ixon in your .bashrc file.

https://stackoverflow.com/a/791800/4522888

Don't forget something like this to keep lots of shell history too:

# Bash history
#
# Write to history file immediately (rather than only when shell is closed). For
# setting history length see HISTSIZE and HISTFILESIZE in bash(1). Don't put
# duplicate lines in the history.
shopt -s histappend
PROMPT_COMMAND='history -a'
HISTSIZE=1000000
HISTFILESIZE=1000000
HISTTIMEFORMAT=1
HISTCONTROL=ignoredups:ignorespace

I have a feeling a copied that from a @Bradley M. Kuhn example at some point.

Ben Sturmfels at 2017-11-11T00:36:58Z

I use PgUP/PgDown for this, I seem to recall Gentoo using this setting by default from many years ago...

zykotick9 at 2017-11-11T18:23:00Z

@George Standish Is that something you've set yourself? I just get tildes when I hit page up/down in Gnome Terminal.

Ben Sturmfels at 2017-11-13T11:20:58Z