Increase the size of history for zsh

I've reached the maximum 10K lines of commands in my zsh history file, but I want to store more commands.

So I set this, in my ~/.zshrc file:

export HISTFILE="$HOME/.zsh_history" export HISTSIZE=1000000000 export SAVEHIST=1000000000 setopt EXTENDED_HISTORY 

And I made sure to run source ~/.zshrc after editing this file.

But when I echo these variables, I get different results:

zsh history is limited

And when I close the terminal and open a new session, I can see that the number of commands in my history file is 10K:

Number of commands in zsh history is 10K again

How can I fix it so that I can store more than 10K commands in my ~/.zsh_history file?

Also, when I run wc -l < $HISTFILE, it gives me a number more than 10K:

enter image description here

What's going on?

1 Answer

I assume that this is not your entire .zshrc and that the variables are set somewhere else.

Make sure you're not using any other script that overwrites these variables, such as oh-my-zsh (example), and that you place your commands at the bottom of your config file.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like