Thomas' Tech Tips

Avoid saving command in shell history

28 January 2024 - Thomas Damgaard

Many shells such as bash do not store commands prefixed with space in the shell history.

Zsh supports this feature also but it must be enabled first.

To enable this, run:

setopt histignorespace

After this, commands prefixed with ` ` does not show up in history.

Filed under: bash, howto, linux, shell, tips, zsh

Back to article list