By default Bash supports the use of EMACs commands to navigate through your command line history. You can move backward through the command history using
Ctl-pand move forward through it with
Ctl-n. Pretty much replaces the arrows.
In addition, I found out you can use
Ctl-rto search through the history. After typing
Ctl-r, enter the letters you are searching for and the command that best matches, is displayed. You can also modify the matched command line.
In addition to EMACs, there are a number of commands that work with the command line history. You can use
!!to run the previous command and
!3to run the command on line 3 of the history list.
I also figured out if you echo the command, (e.g.,
echo !5) you can use
Ctl-pto go back and edit the line.
Ctl-p - Display previous command line
Ctl-n - Display next command line
Ctl-a - Move to the start of the line
Ctl-e - Move to the end of the line
Search Command Lines
Ctl-r - Searches backward through the history for the letters you type
Just start typing the text you are searching for. The closest match will be displayed. The matched command line can be edited and modified.
history - Display the command history
!! - Repeat the last command
!# - Repeat the line number in the history
echo !! - Echo the previous command to standard out