Bash History Command
October 30th 2009 06:55 pm
Recently I came across an idea to more effectively search through the history of commands I typed. I already know about the up arrow will revisit the history in reverse chronological order. However, I would like to have a better way of searching for the command I typed.
Typing CTRL-r would give you a prompt and you can start typing in commands you already entered and it will search through the history and find the most recent command fit the description already provided. Very useful for long command you typed recently and do not want to type them out again.
Another thing I have found is putting HISTCONTRL=erasedups in your ~/.bashrc, it will prevent any duplicates from appearing in the history file and therefore allow for more space to put more commands.