I like using ls --color=auto
and I know how to use dircolors
to change the colors of ls
's output. I want ls
to display read-only files in a color different than "normal" files but don't see an easy way to do that. Have I overlooked something or is this not possible with the standard ls
?
1 Answer
This is not possible with “standard” ls
(or rather, versions of ls
supporting colours, and using dircolors
, so GNU ls
). ls
/dircolors
supports a number of non-extension attributes which can determine colours, but those don’t include “read-only”. You can see the list of attributes in the dircolors
source code, and their description in the built-in example dircolors
database; to see the attributes supported in your own version of dircolors
and ls
, run
dircolors --print-database