Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i'm on freeBSD and trying to colorize ls output, so i've added

alias ls        ls -lhG
setenv LSCOLORS gxfxcxdxbxegedabagacad

to my .cshrc

and it works. but what i really want to - is to be able to colorize (for example) *.pl and *.php files different ways to quicly distiguish it.

Can i modify LSCOLORS some way to colorize files dependong on their name?

share|improve this question
up vote 2 down vote accepted

No. You can't, not with the default ls that ships with FreeBSD.

You can, however, install the gnuls port, which will give you /usr/local/bin/gnuls, which can be set to display colors of files by extension.

share|improve this answer
thanks! will try this port! – k102 Dec 12 '11 at 4:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.