Go to ...

Techpository

A Better Technical Repository

RSS Feed

Linux: Bash History Control


Clear history:
history -c

rm ~/.bash_history
touch ~/.bash_history

Clear a point in history:
history -d ###

Special History Control:

export HISTORYCONTROL=ignorespace (Put a space before any command and it will not be logged)

export HISTIGNORE=”pass:wget:ls” (Any command in the “” will not be logged in the history file)

Note: You can use the unset command to stop bash from remembering a variable:
eg. unset password

By: HAK5