You can tell your shell to ignore commands started with a space
HISTCONTROL=ignorespace
Or you can use HISTIGNORE to always ignore specific patterns. HISTCONTROL=ignorespace
Or you can use HISTIGNORE to always ignore specific patterns. HISTCONTROL=ignoreboth
to use both ignorespace and ignoredups