Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Can anyone tell me how to change the color shades used by "ls --color"?
I imagine that it maybe an some edit to /etc/DIR_COLORS but I cannot find any documentation on the matter. I am somewhat familiar with defining colors in my .bashrc for my command prompt (ie. BOLDPURPLE='\[\033[01;35m\]' && PURPLE='\[\033[00;35m\]'), but how do I change it from using a bright, bold colors to using soft, light colors? Can anyone point me in the right direction? I'm fine with reading through documentation if I can just find the right document! Thanks.
the colors are in the same format, but without the escape sequence.
This from dircolors --print-database:
Code:
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
example: EXEC 01;32
executable files will be bright (bold) green
i don't know if this what you were looking for, but just in case...
my problems was that the bold directory and symlink names were straining my eyes.
so i changed bold fonts to regular fonts, this is how:
1. dircolors -p > dircolors.dat
2. edit this file by hand.
under the TERM entries you'll find a brief explanation of color codes and attribute codes.
as i had no problem with the colors, i only wanted to change the attributes,
so i changed
DIR 01;34
LINK 01;36
to
DIR 00;34
LINK 00;36
3. dircolors dircolors.dat
this will output the code snippet that you should add to your bash startup script to have these colors enabled by default.
Hey, thanks for these posts. But I have tried all that was suggested and I still can't get any of my directory listings to show up in color. I have just had to create a .bashrc file where none existed, but is there a global one I can use? I'm using Gentoo. thx.
Are you adding the '--color' flag to ls? Silly question... Else it'll be to do with the terminal you're using. Anyway, make sure something like this is somewhere in your .bashrc:
Code:
alias ls='ls --color=auto'
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:*.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:*.png=01;35:*.mov=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:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
export LS_COLORS
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.