Take the 2-minute tour ×
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.

I recall that eval "dircolors -b" used to display the colours that LS_COLORS was using, based on the file types or extensions. It was not simply the colour values that were displayed but the colours themselves. I could see the colour in which a .png or .ogg file would be displayed and change it if needed through a custom file.

I find that the output of eval "dircolors -b" is no more in colour.

Can someone kindly explain how I might get it back? Perhaps some environment variable is not getting set. Otherwise, is there a workaround?

share|improve this question
I'm not really understanding how eval "dircolors -b" would ever display the output in color. eval doesn't do any handling on the output of the commands. –  EightBitTony Oct 23 '12 at 11:02
This is what I recall; I might be wrong. If not that command, then some other similar command allowed me to see the extensions listed in the colours they would display in. That much I remember seeing. The question is what command shows output similar to dircolors but in the respective colours? Sorry for the bother. –  chandra Oct 23 '12 at 11:31
@Stéphane Gimenez: Your expansion of abbreviations at that weblink is very helpful. I have three abbreviations, rs, ca, and mh that are not included above. Can you please tell me where to find their expansions? Thanks –  chandra Oct 26 '12 at 18:25
add comment

1 Answer

up vote 2 down vote accepted

Try this script, but the output might just wired you out ...

(dircolors -b >/dev/null;  # run in a subshell so it won't crash current color settings
 IFS=:; for x in ${LS_COLORS[@]};   # for all colors
     IFS='='; echo -e "\E[${x##*=}m${x%%=*}";  # echo color and extension

enter image description here

share|improve this answer
Thank you. I remember only the file extensions showing up in their respective colours. I need to do some digging up to understand what IFS is though. –  chandra Oct 23 '12 at 18:48
add comment

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.