[SOLVED] ls: some directory names are displayed within a box.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ls: some directory names are displayed within a box.
Slackware 14.0
ls 8.19
Some directory names are displayed within a box by ls. Say, if the characters are blue, then the box is green. If black and white (no color option) then black on white. It is not a result of the options field in /etc/fstab, because it does not happen with all dirs. There must be sometthing wrong in LS_OPTIONS. But what?
OK. I now see. drwxrwxrwx gets that efect (hightlighting). drwxr-xr-x does not. So the remedy is easy: 'chmod -r g-w *' and 'chmod -r o-w *'. But any way to avoid the highlighting no matter how the permissions are set?
Not so easy. Because chmod I need then to work only on directories.
OK. I now see. drwxrwxrwx gets that efect (hightlighting). drwxr-xr-x does not. So the remedy is easy: 'chmod -r g-w *' and 'chmod -r o-w *'. But any way to avoid the highlighting no matter how the permissions are set?
But why does it need a "remedy"? If those permissions are set that way for a reason the hilighting is only showing you what they are.
[EDIT]
Forgot to add - to disable hilighting completely use --color=never on ls. Probably if you added to your .bashrc
If I did post it was because I had some time ago used --color=never, but it resulted in boxes all the same, only that black on white. But I do not remember the exact settings in /etc or ~/. But now the problem is solved thanks to your post, because it somehow works. Furthermore, I changed the variable COLOR in /etc/profile.d/coreutils-dircolors.sh from 'auto' to 'never', so I have identical settings for root and me.
For what its worth, the colors ls uses for various files are controlled by the LS_COLORS environment variable. They can be modified easily by using the dircolors command.
Short form, when dircolors is run, it reads the color settings from its configuration file and formats them into a command string that can be used to set the value of LS_COLORS. A simple line in your bashrc or similar startup file can be used to evaluate this output and set the variable automatically.
Then just modify the dircolors settings file to get the colors you want. dircolors -p will print out its default file settings with detailed comments on what does what.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.