What are your LS_COLORS?

User1 picture User1 · Jun 21, 2010 · Viewed 21.7k times · Source

After installing a full version of Cygwin, I open up the MinTTY shell and I like the green on black. However, when I do an 'ls', I get a dark blue for directories. It's not very readable. I found that the LS_COLORS environment variable controls the output of ls. Here is my current default:

no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:
or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:
*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:
*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:
*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:
*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:
*.png=00;35:*.tif=00;35:

Changing from di=00;34 to di=00;94 makes ls much more readable. Has anyone found other useful tweaks?

Answer

John Feminella picture John Feminella · Jun 21, 2010

For readability purposes, instead of changing the colors that LS_COLORS produces, it's smarter to change how your terminal interprets those colors by mapping "dark blue" to a more readable RGB value. If dark blue is unreadable for you in ls, it's going to be unreadable for you everywhere.

Generally, the main time you should change LS_COLORS is whenever you want ls to know about other extensions or to treat them separately.