Directory listing colors in Terminal

I like to have colors in my directory listings when in Terminal. Blue for folders, red for executable, etc. I’ve been doing this for years, and I always forget it’s not the default.

I use tcsh (still, yes), so I have the following in my .tcsh file:

setenv LSCOLORS "exfxcxdxbxegedabagacad"

Gibbery, yes. But it specifies colors for ls listings.

If you use bash, the following in .bash_profile should work:

export LSCOLORS="exfxcxdxbxegedabagacad"

(Remember to do a source .tcsh or source .bash_profile after editing the file.)

If it doesn’t work, you might still have to set CLICOLOR to true, and possibly set TERM to xterm-color.

And of course you can change the colors — do a man ls for more info.

20 Dec 2009

Archive