##########################
## Bash History
##########################

# showing the history
history

# removing a line (ex: 100) from the history
history -d 100

# removing the entire history
history -c

# printing the no. of commands saved in the history file (~/.bash_history)
echo $HISTFILESIZE

# printing the no. of history commands saved in the memory
echo $HISTSIZE

# rerunning the last command from the history
!!

# running  a specific command from the history (ex: the 20th command)
!20

# running the last nth (10th) command from the history
!-10

# running the last command starting with abc 
!abc

# printing the last command starting with abc 
!abc:p

# reverse searching into the history
CTRL + R

# recording the date and time of each command in the history
HISTTIMEFORMAT="%d/%m/%y %T "