variable

HISTSIZE

Limit in-memory history entries; negative values mean unlimited.

Formal Syntax & Structure

bash syntaxbash
HISTSIZE=2

Return Value

entry count

Limit in-memory history entries; negative values mean unlimited.

Working Example

Example Snippetbash
HISTSIZE=2HISTFILE="$PWD/history.txt"HISTFILESIZE=20history -chistory -s firsthistory -s secondhistory -s thirdhistory -w "$HISTFILE"cat "$HISTFILE"
Bash Reference