HISTCONTROL
HISTCONTROL is an environment variable used by some Unix-like shells, most notably Bash, to control how commands are added to the shell's command history. It influences which commands are saved and whether duplicate commands are ignored or preserved. The value of HISTCONTROL is a colon-separated list of keywords.
Common keywords include ignoredups, which prevents duplicate consecutive commands from being saved. For example, if you
If HISTCONTROL is not set, or is unset, then all commands are typically saved to the history,