Your Question: How Do I Set the History Size in Linux?
Contents

How do I change the history size in Linux?

Increase Bash History Size

Increase HISTSIZE – the number of commands to remember in the command history (the default value is 500). Increase HISTFILESIZE – the maximum number of lines contained in the history file (the default value is 500).

How do I make bash history Unlimited?

Setting HISTFILESIZE to a value less than zero causes the history file size to be unlimited (setting it to 0 causes the history file to be truncated to zero size). bash –version to check your bash version. (export PROMPT_COMMAND=’history -a’) can flush commands to bash history immediately.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest