history # show all
history | tail -5 # show last 5
history | grep text # search for text
# Set time format of bash history (current session)
HISTTIMEFORMAT="[%D_%T] "
# Do not add item to bash history (current session)
HISTCONTROL=ignoredups # ignore adding duplicate lines to history
HISTCONTROL=ignorespace # ignore adding lines start with space to history
HISTCONTROL=ignoreboth # ignore both dupes and lines started with a space
# Set number of history elements (current session, default 500)
HISTFILESIZE=2500
sudo add-apt-repository ppa:ultradvorka/ppa && sudo apt-get update && sudo apt-get install hstr && hstr --show-configuration >> ~/.bashrc && . ~/.bashrc
Type Ctrl R at the command line and start typing the previous command.