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.

  • Is this something that LS_COLORS (softwaregravy.wordpress.com/2010/10/16/ls-colors-for-mac) 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.

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