Created
March 3, 2023 02:26
-
-
Save nightcrawler-/c2d4cf4ed1488bcff4136a5a11ce5e30 to your computer and use it in GitHub Desktop.
deduplicate .zsh_history
This file contains 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
awk '!a[$0]++' ~/.zsh_history > ~/.zsh_history_new && mv ~/.zsh_history_new ~/.zsh_history | |
# This command reads the current Zsh history file (~/.zsh_history), | |
# removes duplicates using awk, saves the unique commands to a new file (~/.zsh_history_new), | |
# and finally replaces the old history file with the new one. | |
# After running this command, you should have a Zsh history file without any duplicates. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment