By default Mac OS X’s Terminal application uses BASH (Bourne Again Shell) but doesn’t have directory and file color highlighting enabled to indicate resource types and permissions settings.
Enabling directory and file color highlighting requires that you open (or create) ~/.bash_profile in your favorite text editor, add these lines:
export CLICOLOR=1 export LSCOLORS=ExFxCxDxBxegedabagacad
… save the file and open a new Terminal window and type any variant of the “ls” command:
ls ls -l ls -la ls -lah
The output should now be in color.
More details on the LSCOLORS variable can be found by looking at the man page for “ls”:
LSCOLORS needs 11 sets of letters indicating foreground and background colors:
- symbolic link
- block special
- character special
- executable with setuid bit set
- executable with setgid bit set
- directory writable to others, with sticky bit
- directory writable to others, without sticky bit
The possible letters to use are:
a black b red c green d brown e blue f magenta c cyan h light grey A block black, usually shows up as dark grey B bold red C bold green D bold brown, usually shows up as yellow E bold blue F bold magenta G bold cyan H bold light grey; looks like bright white x default foreground or background
By referencing these values, the LSCOLORS variable setting mentioned above translates to:
Bold blue with default background for directories, Bold magenta with default background for symbolic links Bold green with default background for sockets ... etc.