Apple's Mac line.

Bash history: Ignore duplicate commands

Your rating: None Average: 3 (1 vote)

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)

Tags: Mac, Unix, Linux

Bash history quick recall

Your rating: None Average: 4 (1 vote)

When using the command line, like Terminal for Mac OS X there are two quick ways to recall a command you entered previously. By using the Up & Down arrow keys on the keyboard allows you to scroll through your command history. When a command is much older than a minute or two ago then a auto-complete search is possible by pressing the Ctrl+R keys together and typing in any portion of a previous command. The auto-complete search is way cool; give it a try.

Tags: Mac, Unix, Linux