Created
April 23, 2021 11:24
-
-
Save rg443a/e8a3cf1ffaafe474d6fa619682869835 to your computer and use it in GitHub Desktop.
bash history remove duplicates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tac $HISTFILE | awk '!x[$0]++' | tac | sponge $HISTFILE | |
awk '!x[$0]++' ~/.bash_history | |
tac ~/.bash_history | awk '!x[$0]++' | tac | |
# https://medium.com/@dblume/have-only-unique-lines-in-your-bash-history-941e3de68c03 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment