How to distinguish broken link and good link using ls --color=auto?

Matrix Mole matrixm at
Wed Nov 16 10:01:30 PST 2011

On Wed, Nov 16, 2011 at 9:18 AM, Peng Yu <pengyu.ut at> wrote:

> ls --color=auto on ubuntu distinguishes broken and good links. But it
> seems that the same command does not do so using the macports version.

The color output for the ls command is set by some variables in your
shell. The LSCOLORS and CLICOLOR at the least. You can get some
details regarding them by doing 'man ls' and looking at the -G flag,
along with those two variables. Below is the entries from my .profile
that I use for colorized out. Feel free to take it for yourself or
tweak it so that it provides you the output you prefer (not sure if I
got the broken alias configured in there or not, it's been a while
since I set that up).

# LS Colors 2010-03-15_02:42
# default LSCOLORS is exfxcxdxbxegedabagacad
export LSCOLORS=gxfxcxdxbxegedabagacad

# force color and directory identifier in ls output
alias ls='/bin/ls -FG'

I'm sure someone else can provide much more detailed information
regarding this, not to mention with the knowledge of what variables to
set you could probably find an overload of information on the internet
at large (that's where i dug up the information for my settings).

Matrix Mole

More information about the macports-users mailing list