Configure Bash or Zsh shell

When moving between Linux systems that often default to Bash, and macOS systems that often default to Zsh, one may wish to change the default shell parameters.

For example, to remove duplicate entries in shell history, so that pressing “up” on repeated commands doesn’t make you press “up” repeatedly to get to the last non-duplicated command, set like the following.

Bash: ~/.inputrc: ignore duplicate lines, and omits lines that start with space.

export HISTCONTROL=ignoreboth

Zsh: ~/.zshrc: approximately the equivalent of the above Bash setting.

setopt hist_ignore_dups
setopt hist_ignore_space