HISTFILE
isn't set in my .zshrc
file.
To which file is zsh history saved by default?
Or, is the history just being stored in memory?
Increasing the History File Size Unfortunately, zsh's default history file size is limited to 10000 lines by default and will truncate the history to this length by deduplicating entries and removing old data. Adding the following lines to . zshrc will remove the limits and deduplication of the history file.
The background. In Bash, your command history is stored in a file ( . bash_history ) in your home directory.
In my terminal, ZSH, there's a file called ~/. zsh_history , and a similar one for Bash. To remove the command, open that file and remove the entry from the list. Open a new terminal window, and the bad command is gone.
zshrc file located in your home directory. It's a hidden file, so you might not see it in your home directory, but you can view it by running open ~/. zshrc from the terminal.
Zsh has no built-in default value for HISTFILE. The zsh distribution comes with a setup wizard for new users which has the value ~/.zsh_history built in...
More by Gilles on Command history in Zsh - Unix SE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With