You are not logged in.

#1 2011-11-02 18:53:39

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

LS_COLORS - how to make dirs colored but not marked?

Hello!

export LS_COLORS='di=01;34'
ls -l --color=auto /home/alex

This makes directories blue in "ls" command but some of them also become marked with green background. I am trying to make them only blue, without any background. Is it possible to do that?

Offline

#2 2011-11-02 19:02:52

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: LS_COLORS - how to make dirs colored but not marked?

You can customize your colours in the .dir_colors file...

# edit: mine is in my dotfiles repo

Last edited by jasonwryan (2011-11-02 19:03:23)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2011-11-03 08:46:32

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: LS_COLORS - how to make dirs colored but not marked?

How does it work for zsh and urxvt? I copied your .dir_colors file, did

ls --color=auto -la

and colors are not what they should be. They didn't change.

Offline

#4 2011-11-03 08:53:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: LS_COLORS - how to make dirs colored but not marked?

In my .bashrc I have:

eval $(dircolors -b ~/.dir_colors)

as per the man page I linked to:

This environment variable is usually set by a command like
    eval 'dircolors some_path/dir_colors'
found in a system default shell initialization file, like /etc/profile or /etc/csh.cshrc.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2011-11-03 09:00:12

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: LS_COLORS - how to make dirs colored but not marked?

Thanks, now it works. But again - directories have green background if chmod 777. I want all dirs to be just blue regardless of permissions.

Offline

#6 2011-11-03 09:01:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: LS_COLORS - how to make dirs colored but not marked?

Then remove the executable option -- or make it blue as well...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2011-11-03 09:21:12

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: LS_COLORS - how to make dirs colored but not marked?

Then remove the executable option

On dirs? I need them. (Or I don't understand what options you're talking about - sorry)

or make it blue as well

How do I make all dirs blue regardless of their permissions?

Offline

#8 2011-11-03 09:49:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: LS_COLORS - how to make dirs colored but not marked?

Mr. Alex wrote:

Then remove the executable option

On dirs? I need them. (Or I don't understand what options you're talking about - sorry)

No: in .dir_colors...

or make it blue as well

How do I make all dirs blue regardless of their permissions?

See man page linked to above:

EXEC color-sequence
    Specifies the color used for a file with the executable attribute set.

Rather than rushing to post here: spend a little time reading the documentation and playing with the options.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2011-11-03 11:38:38

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: LS_COLORS - how to make dirs colored but not marked?

Rather than rushing to post here: spend a little time reading the documentation and playing with the options.

jasonwryan, I think you don't understand me. I looked all the man page through. EXEC option is for files. Plus it still doesn't do what i need.

I have directories with drwx------ and drwxr-xr-x permissions. They are shown just blue now. And I have dirs with drwxrwxrwx permissions and they have green background. I don't want this background. Tried EXEC - it's for files. And tried to combine it with DIR options - doesn't work this way at all. Also - executable option may be in three different places in permissions. I can't figure this out.

Offline

#10 2011-11-03 12:16:45

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: LS_COLORS - how to make dirs colored but not marked?

I don't want this background.

=>

42     for green background


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#11 2011-11-04 11:12:45

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: LS_COLORS - how to make dirs colored but not marked?

DIR            01;34;40
DIR:ex         01;34;40
ex 01;34;40
:ex 01;34;40

Is any of these right?

There are a couple of discussions I found:
http://www.linuxquestions.org/questions … em-584383/
http://www.linuxforums.org/forum/suse-l … olors.html
Noone seems to find how to remove that green background.

Did anyone of you make "drwxrwxrwx" just blue, without green background?

Offline

#12 2011-11-04 14:39:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: LS_COLORS - how to make dirs colored but not marked?

All the information you require to finding a solution is in this thread.

Here is a hint, use what bohoomil told you and look in $LS_COLORS itself. Or in the dir_colors file, whatever it is.

Last edited by fsckd (2011-11-04 14:51:01)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#13 2011-11-04 15:31:03

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: LS_COLORS - how to make dirs colored but not marked?

If you want to remove the background, simply delete the value responsible for it, e.g.:

DIR 00;34

-- for dark blue foreground, or

DIR 01;34

for the bright blue one.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#14 2020-10-18 11:29:51

860lacov
Member
Registered: 2020-05-02
Posts: 475

Re: LS_COLORS - how to make dirs colored but not marked?

Fun with archeology for me.

I'm trying to make my ls output colorized.
I read dir_colors

Should I put this:

eval "$(dircolors [option]… [file])"

into my .bashrc and that's all?

What should I set as an option?
Is it -b because I use bash shell?
Where is [file] and what should be inside?

Last edited by 860lacov (2020-10-18 11:30:05)

Offline

#15 2020-10-18 12:19:32

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: LS_COLORS - how to make dirs colored but not marked?

860lacov wrote:

Fun with archeology for me.

Don't do that. Please do not necrobump.

Open your own topic and refer back to this one if you think it is appropriate.

Closing.

Offline

Board footer

Powered by FluxBB