Super User is a question and answer site for computer enthusiasts and power users. 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

This question already has an answer here:

Every once in a while I have to list some files (~20-50) in Bash on Linux || Mac.
These files are from four different file types.

ls nand2tetris/myChips/  
And16.**hdl** And16.**cmp**    And16.**tst**    And16.**out**  

Is it possible to colorize every file type in a different color, without changing the formatting? I still want to have the standard ls multi column, multi row output, not the kind of formatting that ls -l presents.

If the solution to the problem is a different technique from distribution to distribution, it would be nice to collect as many solutions as possible in this thread.

share|improve this question

marked as duplicate by Doug Harris, Dave M, Scott, Tog, KronoS Apr 17 '13 at 17:26

This question was marked as an exact duplicate of an existing question.

Is this something that LS_COLORS ( doesn't do? Reading your question it seems like all you need to to define colors for your file types in the LS_COLOR environment variable. I haven't personally noticed an ls which didn't support this for quite some time, but I'm sure there are variations that do not do this. – SuperMagic Apr 15 '13 at 23:03

I have never been in need of do it, but you might want to read this, I think that it answers your question.

share|improve this answer

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