LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-08-2013, 06:26 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,081

Rep: Reputation: 45
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?
 
Old 01-08-2013, 06:54 PM   #2
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,669

Rep: Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579
It sounds like hilighting for 777 permissions.

Could you paste an example of ls -l which is showing like that.
 
Old 01-08-2013, 07:33 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,081

Original Poster
Rep: Reputation: 45
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.
Attached Images
File Type: png snapshot1.png (101.5 KB, 41 views)

Last edited by stf92; 01-08-2013 at 07:36 PM.
 
Old 01-08-2013, 07:49 PM   #4
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,669

Rep: Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579
Quote:
Originally Posted by stf92 View Post
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]

Last edited by astrogeek; 01-08-2013 at 07:54 PM.
 
Old 01-08-2013, 07:54 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,081

Original Poster
Rep: Reputation: 45
They got that way after copying whole big trees from DVD. Now, it has an adverse effect on my eyes.
 
Old 01-08-2013, 07:56 PM   #6
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,669

Rep: Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579
Quote:
Originally Posted by stf92 View Post
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.
 
Old 01-08-2013, 08:33 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,081

Original Poster
Rep: Reputation: 45
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.
 
Old 01-08-2013, 11:40 PM   #8
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,669

Rep: Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579Reputation: 579
You are welcome, glad that worked for you!
 
Old 01-09-2013, 12:24 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,806

Rep: Reputation: 810Reputation: 810Reputation: 810Reputation: 810Reputation: 810Reputation: 810Reputation: 810
When storing or archiving stuff to CD/DVDs, stick the files within a tar container to preserve permissions.
 
Old 01-09-2013, 02:50 PM   #10
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
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.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] List files/directory names without directory contents? littlebigman Linux - Software 2 05-03-2011 04:42 AM
[SOLVED] How to changing same file names by their directory names? bayaraa_u Linux - General 3 04-09-2010 08:26 AM
Contents of Directory Displayed using Arithmetic Expression Mr. ameya sathe Programming 3 01-26-2008 11:04 AM
No directory paths displayed at prompt HEMMLine Linux From Scratch 1 03-28-2007 04:03 PM
shell error messages not displayed as a message box!!! user222 Linux - General 10 10-25-2004 01:11 AM


All times are GMT -5. The time now is 04:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration