Customize Prompt On Mac OS X

por | 10 septiembre, 2007

In the comments of Customize Prompt On Mac OS X, jh asks how to color your command prompt:

How about the colored bits below the command
prompt?
I’ve noticed that when I do an ‘ls’ on my own mac it tends to
be monochromatic, however, when I’m ssh-d in to a linux machine and
‘ls’ I tend to get output that colors directories, and executables
differently.
Why is this? And is there any way to get my own mac’s
output to be color coded as well?

Of course there is!

Open up ~/.bash_profile and add the following two lines:

export CLICOLOR=1
 export LSCOLORS=ExFxCxDxBxegedabagacad

Save, exit, log out, log in, and there you are!

Terminal-Coloring

Update: For tcsh users, I was able to get the same effect putting the following in ~/.tcshrc:

setenv CLICOLOR "1"
 setenv LSCOLORS "ExFxCxDxBxegedabagacad"

For iTerm users, add the following to ~/.bash_profile:

export TERM=xterm-color
 alias ls='ls -G'
 alias ll='ls -hl'