warning: Creating default object from empty value in /home/webdevde/public_html/modules/taxonomy/ on line 33.

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

List all files, even hidden ones

Your rating: None Average: 3 (1 vote)

When administering a Linux/Unix computer, one of the most common (and important) commands is how to list the contents of a directory. On Linux/Unix, the following command will display all files in a directory, even if they are hidden.

ls -Flash

The command above has some flags set (otherwise known as parameters), which is the "-Flash" portion of the command. I prefer this set of flags, and in that order since it is easy to remember the word "Flash" versus random orders of each flash like "lhaFs". These set of flags I like show the list of files vertically with many attributes shown and colorful visual indicators.

Tags: Unix, Linux