Dude, you didn't answer the actual question. Try reading it again.
The question was what is the difference between HISTSIZE and HISTFILESIZE.
The OP is right, the bash man page is somewhat confusing, it states:
which sound kinda similar.
pandeesh - the answer is you can use either if you want to increase the number of items in your history; however HISTFILESIZE refers specifically to the actual history file itself (e.g. ~/.bash_history) which is written when the shell exits. HISTSIZE refers specifically to history as saved in memory.
These 2 Users Gave Thanks to King Clarity For This Post:
The history "file" is not updated as you type the commands. The commands get stored in a "list" separately (accessed by the history command). The number of these stored commands is controlled by HISTSIZE value. When the shell (interactive) exits, the last $HISTSIZE lines are copied/appended to $HISTFILE from that "list". If HISTFILESIZE is set, then after this operation, it is ensured that only $HISTFILESIZE lines (latest) exist in $HISTFILE. And when the shell starts, the "list" is initialized from $HISTFILE upto a maximum of $HISTSIZE commands.
@King_Clarity
Please do not respond to 2-month old posts unless you have something new to add. The O/P @pandeesh is known to rarely read and understand man pages.
Hi All,
I am connecting to a sun solaris 5.9 unix (korn shell) server using the x terminal. There is some problem with the HISTORY File where the HISTSIZE env variable is not working. Although the HISTSIZE is set to 20 already but the HISTORY file keep increasing and exceeded the size.
There... (5 Replies)