How do i turn off dir colours ?

Permissions, domain/LDAP, power, security, notification and more.
Locked
User avatar
deejc
Posts: 111
Joined: 09 Mar 2021, 03:35

How do i turn off dir colours ?

Post by deejc »

i thought it would be in /etc/profile LS_COLORS so i commented it out in both etc and etc.default but i still this annoying green background on directories

Code: Select all

#export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
Screenshot 2021-05-09 at 09.43.07.png
F2-220 WITH 2 x WD RED 2TB RUNNING 4.2.17
User avatar
outkastm
Posts: 1185
Joined: 29 Dec 2020, 23:52

Re: How do i turn off dir colours ?

Post by outkastm »

dircolors default settings are normally embedded during build.
To adapt the settings, create a modified config file which is imported at login
Save the default file as backup

Code: Select all

 
dircolors -p > /etc/dircolors.orig
dircolors -p > /etc/DIR_COLORS
adapt the file /etc/DIR_COLORS as you need

create an entry in /etc/profile.d to load your defined colors

Code: Select all

vi /etc/profile.d/dircolors.sh
with this content

Code: Select all

# === Create DEFAULT LS_COLORS ENVIRONMENT VARIABLE ===========================
# /etc/DIR_COLORS is a data file from:  $ dircolors -p > /etc/DIR_COLORS
eval "$(dircolors -b /etc/DIR_COLORS)"      # This reads /etc/DIR_COLORS
# and then runs these two commands:   
#
#   $ LS_COLORS=...     # <-- where this value is created from /etc/DIR_COLORS
#   $ export LS_COLORS
login again and your modified colors should work
Attachments
putty_q7knD3ASOz.png
User avatar
deejc
Posts: 111
Joined: 09 Mar 2021, 03:35

Re: How do i turn off dir colours ?

Post by deejc »

Thanks a lot I’ll try that in a while
F2-220 WITH 2 x WD RED 2TB RUNNING 4.2.17
User avatar
deejc
Posts: 111
Joined: 09 Mar 2021, 03:35

Re: How do i turn off dir colours ?

Post by deejc »

Worked perfectly, thanks a lot

FYI for anyone else looking for what needs changing, i edited these lines and i no longer get that annoying background on folders

Code: Select all

 
STICKY_OTHER_WRITABLE 01;34 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 01;34 # dir that is other-writable (o+w) and not sticky
F2-220 WITH 2 x WD RED 2TB RUNNING 4.2.17
Locked