Skip to content

Instantly share code, notes, and snippets.

@nr1q
Last active January 25, 2019 19:16
Show Gist options
  • Save nr1q/44b8d84e5613ae5c43bb2220fc0ac7f6 to your computer and use it in GitHub Desktop.
Save nr1q/44b8d84e5613ae5c43bb2220fc0ac7f6 to your computer and use it in GitHub Desktop.
Get history list without duplicates
cat ~/.bash_history | nl | sort -k 2 | awk '{$1=$1};1' | uniq -f1 | sort -n | cut -d ' ' -f 2- > ~/.bash_history_noduplicates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment