Mac OSX tip: ls command color output

If you have OSX tiger simply grab the fileutils from fink with

fink install fileutils

Then add the following to your .profile:

export LS_OPTIONS='--color=auto'

eval "`/sw/bin/dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -lah'
alias l='ls $LS_OPTIONS -lA'

In leopard it's even easier; simply use the -G switch:

alias ls='ls -G'
alias ll='ls -lahG'
alias l='ls -laG'

Completely non-essential but I find it quite handy to be able to tell apart dirs and files by colour.

comments powered by Disqus