How to colourise hidden files in `ls` file listings

colorsfilenamesls

LS_COLORS environmental variable lets you decide on colours for different file types for GNU coreutil's ls command, such as directories, regular files, links etc. I suppose that dot files are considered a variation of the Linux file types and not a type on its own hence there is no option for specifying a display colour for them.

Is there any (other) way you can make ls listings show hidden files in a different colour?

Best Answer

If you're only sorting by name, this might help:

alias ll='LS_COLORS=$LS_COLORS:"di=0;34:" ; S_COLORS=$LS_COLORS:"fi=0;37:" ; export LS_COLORS; ls -dHhl --color=auto .*; LS_COLORS=$LS_COLORS:"di=1;94:" ; LS_COLORS=$LS_COLORS:"fi=1;37:" ; export LS_COLORS$

However, it splits the ls command in two parts, one for hidden files and folders, one for the rest.