ugly color for directories in gnome- terminal?
Solution 1
The answer to your question is hidden in the answers to both What do the different colors mean in the terminal? and How do I change the color for directories with ls in the console?
The cause of the green highlighting is because your directories are writable by other (o+w
) and not sticky.
So that explains why they have green highlighting, but you also ask how to remove it. You say "make it look like the others", by which I assume you mean normal directories. Open up your ~/.bashrc
and append the following to the bottom:
export LS_COLORS="$LS_COLORS:ow=1;34:tw=1;34:"
save the file and then run
source ~/.bashrc
Now they will look the same as any other directory. Take note though that the system thinks this is information you should be able to see, by doing this you will no longer be able to see it easily. Consider choosing a different background color from the list here. I think purple isn't too bad (ow=1;34;45:
)
Explanation:
ow
stands for 'other, writable', tw
is 'sticky, writable' (the other condition that has a green background). I found these values by examining the contents of $LS_COLORS
on my system, looking for values with a background color of 42 (green). The color code has 3 columns (unused columns are left out):
bold;font-color;bg-color
Solution 2
This is because you have given write
permission to other, meaning other than file owner and not in the group. Check permissions with ls -l
or ll
. Remove write permission from other by chmod 0755 directory_name
, so it will look similar to other directories.
Solution 3
I did: 'chmod o-w -v -R *' to the directory I had trouble reading. It removes others write recursively. I may yet encounter other errors with this 'chmod' process. I'll report back if I come across errors.
Related videos on Youtube
Ashu_FalcoN
I'm Ashu, Student Interest in Web,Android & Linux. Open-source supporter.
Updated on September 18, 2022Comments
-
Ashu_FalcoN over 1 year
Some of my folders are highlighted in green
What does the green highlighting means? How can I remove the highlight and make them look similar to others?
terminal : gnome-terminal.
system : Ubuntu 16.04
-
steeldriver over 7 yearsApologies - possibly What do the different colors mean in the terminal? is closer to what you are asking: specifically, the green background probably indicates that the directories have "others writeable" permission
-
ThisIsNotAnId over 7 yearsA simple solution is to use the
dir
command instead ofls
orls -l
. For a very detailed explanation see askubuntu.com/questions/103913/… In particular see Eliah Kagan's answer. -
web.learner over 7 yearsReopening this because the other question does not explain how to change the highlighting. This question covers some of it, but I'm not sure it applies here or is enough to answer the question.
-
-
chaskes over 7 yearsJudging by the names of most of the dirs removed write permission might change the behavior or break some apps. You might want to warn about that.
-
High Performance Rangsiman almost 4 yearsThis works for me!
-
Kurankat almost 4 yearsYou are changing permissions on folders, when the OP wants to know how to change the colour.
-
Igor V. over 2 yearsPurple is great suggestion!
-
aafulei over 2 yearsSaved my life ... and my eyes