Skip to content

Instantly share code, notes, and snippets.

@the-paulus
Created April 8, 2018 03:06
Show Gist options
  • Save the-paulus/e403b942b26cf7b033a64bb3c15859f4 to your computer and use it in GitHub Desktop.
Save the-paulus/e403b942b26cf7b033a64bb3c15859f4 to your computer and use it in GitHub Desktop.
Commands to erase bash history
# Clears bash history
cat /dev/null > ~/.bash_history
# Prevent history from being recorded
ln -s ~/.bash_history /dev/null
# A copy of the history is stored in memory and written to the file uppon logout.
# To get around this:
cat /dev/null > ~/.bash_history && history -c && exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment