$HISTIGNORE  –  List of patterns to control what’s saved in the history

$HISTIGNORE is a colon-separated list of patterns. Commands, which are matched by one of the patterns, are excluded from the history and not stored.

Ignored commands are removed from history and also can’t be recalled with the UP or DOWN keys.

Examples

Exclude history and any sudo command from your history:
1
export HISTIGNORE='history:sudo*'
BashSupport Pro is a Bash IDE with support for $HISTIGNOREtry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal