Skip to content

Instantly share code, notes, and snippets.

@aakbar5
Created October 31, 2019 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aakbar5/5218d580763cca72592ee34b3ef303f3 to your computer and use it in GitHub Desktop.
Save aakbar5/5218d580763cca72592ee34b3ef303f3 to your computer and use it in GitHub Desktop.
Ubuntu: Bash history management
# To see top commands
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
# To remove a commands from history
# Replace YOUR_COMMAND with the initials of the command you want to remove from bash history
sed -i '/^YOUR_COMMAND/d' ~/.bash_history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment