When you get comfortable with bash shell commands you may at some point be annoyed with duplicate commands coming up and forcing you to scroll through those repetitive shell commands. To have your shell ignore duplicate commands and even ignore specific commands (like ls) then follow these quick tips:

Ignore duplicate bash shell commands

export HISTCONTROL=ignoreboth

Ignore a specific bash shell command

export HISTIGNORE="ls" (history will ignore the ls command)

Ignore multiple specific bash shell commands

export HISTIGNORE="ls:pwd:exit:mount" (history will ignore the ls, pwd, exit, and mount commands)

Your rating: None Average: 3 (1 vote)

Tags: Mac, Unix, Linux