Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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