The colors of ls
can represent the permissions; the defaults for some systems is to show directories where everyone has write permissions with a green background:
You can change the colors by editing your $LS_COLORS
variable using dircolors
(from man ls
):
Using color to distinguish file types is disabled both by default and
with --color=never. With --color=auto, ls emits color codes only when
standard output is connected to a terminal. The LS_COLORS environment
variable can change the settings. Use the dircolors command to set it.
The syntax is admittedly kind of annoying here but you can change this color by creating a file with the colors you want and saving it as ~/.dircolors
:
dircolors -p > ~/.dircolors
That command will print the defaults into ~/.dircolors
. You will then need to edit that file and change this line:
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
For example, to make it black text on a red background (see here for a list of color codes):
OTHER_WRITABLE 30;41 # dir that is other-writable (o+w) and not sticky
You don't need to have all the defaults, you can also just create a file with a single line, redefining just the one you want to change. Anyway, once you have created the file, load it with:
eval "$(dircolors ~/.dircolors)";
And here it is in action:
To have that happen automatically, add the eval
command above to your ~/.bashrc
file.