Colorized 'ls' in the Terminal

Nov 22, '01 05:00:35AM

Contributed by: conceptDawg

I was talking to someone over on MacSlash and they commented that their 'ls' command didn't output in color. Hmmph...mine did. I looked and found that I had some "carry-overs" in my .cshrc file from my SGI box. To give yourself colorized 'ls' add the following lines to the end of your .cshrc (if you are using tcsh as your default shell):

  alias ls 'ls-F'
setenv LS_COLORS 'di=35:fi=0:ex=31:or=90'
set color
You can change the colors and/or styles for different types of files by using the variables on the second line. Linux StepbyStep provides a good reference guide on color setting.

Hope everyone enjoys their color!

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20011122050035246