variable
HISTFILE
History persistence pathname. Explicit history writes can name a different file.
Formal Syntax & Structure
bash syntaxbash
HISTFILE=/private/pathReturn Value
file path
History persistence pathname. Explicit history writes can name a different file.
Working Example
Example Snippetbash
HISTFILE="$PWD/history.txt"HISTSIZE=20HISTFILESIZE=20history -chistory -s 'printf demo'history -s 'printf example'history -w "$HISTFILE"cat "$HISTFILE"