1) To display timestamp with commands
# set HISTTIMEFORMAT='%F %T '# history
2) To search the command line history, press Ctrl + R and start typing the command. The closest match from the history will be displayed. When the expected command appears press enter to execute. Press the right arrow to select the command and start editing.
3) To execute a particular command from history, find out the command number. Command number can be found from the left most column when the history command is executed. Then type !<command number>. For e.g. !5 to execute the command with number 5.
4) To execute a previous command from history that starts with a particular word, type !<starting few letters of the command>. Then the immediate previous command that start with those words will be executed.
5) By default the history file is stored in ~/.bash_history
6) To avoid duplicates in the command history
export HISTCONTROL=ignoredups