LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   ls: some directory names are displayed within a box. (http://www.linuxquestions.org/questions/slackware-14/ls-some-directory-names-are-displayed-within-a-box-4175444742/)

stf92 01-08-2013 07:26 PM

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?

astrogeek 01-08-2013 07:54 PM

It sounds like hilighting for 777 permissions.

Could you paste an example of ls -l which is showing like that.

stf92 01-08-2013 08:33 PM

1 Attachment(s)
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.

astrogeek 01-08-2013 08:49 PM

Quote:

Originally Posted by stf92 (Post 4865783)
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

Code:

alias ls='ls --color=never'
[/EDIT]

stf92 01-08-2013 08:54 PM

They got that way after copying whole big trees from DVD. Now, it has an adverse effect on my eyes.

astrogeek 01-08-2013 08:56 PM

Quote:

Originally Posted by stf92 (Post 4865796)
They got that way after copying whole big trees from DVD. Now, it has an adverse effect on my eyes.

See updated last post to turn colors off.

stf92 01-08-2013 09:33 PM

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.

astrogeek 01-09-2013 12:40 AM

You are welcome, glad that worked for you!

ruario 01-09-2013 01:24 AM

When storing or archiving stuff to CD/DVDs, stick the files within a tar container to preserve permissions.

David the H. 01-09-2013 03:50 PM

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.

Read man dircolors and info dircolors for more.


All times are GMT -5. The time now is 12:42 AM.