Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
03-14-2005, 04:14 AM
|
#1
|
Member
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70
Rep:
|
how to change colors of ls listing?
At my command line when I do a "ls" listing, it shows
me directories / files in different colors.
The navy blue on black is hard to see for directories.
Where is that file again when I can change the color of directories to something more visible?
Thanks.
|
|
|
03-14-2005, 04:17 AM
|
#2
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
You don't mention your distro, so it could be in a different place:
/etc/DIRCOLORS (or /etc/dircolors)
The above is the file that holds the codes for (among other things) color settings.
Hope this helps.
|
|
|
03-14-2005, 04:27 AM
|
#3
|
Member
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70
Original Poster
Rep:
|
- I have Redhat 9.
- I edited the /etc/DIRCOLORS file and changed the DIR line so that it was the same color as FIFO (which is a nice orange/yellow), so now my DIRCOLORS file reads:
...
DIR 40;33
LINK 01;36
FIFO 40;33
...
- However, directories are still navy blue and FIFO entries are orange/yellow. (no change)
- I logged out and logged back in but it is the same.
How can I "apply these changes?"
Thanks.
|
|
|
03-14-2005, 04:36 AM
|
#4
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi again,
After changing dircolors and starting a new (login) shell, changes should be visible immediately.
Take a look at your /etc/profile (and/or /etc/bashrc), it should be checked/started from there. Something like:
Code:
if [ -f "/etc/dircolors" ]
then
eval $(dircolors -b /etc/dircolors)
if [ -f "$HOME/.dircolors" ]
then
eval $(dircolors -b $HOME/.dircolors)
fi
fi
Also take a look at man dircolors (especially the -b and -c option). You could try starting it by hand to check if that works.
Hope this helps.
|
|
|
03-14-2005, 05:12 AM
|
#5
|
Member
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70
Original Poster
Rep:
|
Ok, the colors changed but only after I copied
/etc/DIR_COLORS to /root/.dircolors and then
closed and opened the shell window.
Is there a way to change the colors GLOBALLY or was that supposed
to happen when I changed my /etc/DIR_COLORS file?
|
|
|
03-14-2005, 05:24 AM
|
#6
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
Yep, changing /etc/DIRCOLORS is for global setting.
One thing I can come up with: Are you running a gui (as opposed to commandline login)? It could be that you need to restart the gui, although that's not 'the linux way' (my opinion).
|
|
|
03-14-2005, 06:09 AM
|
#7
|
Member
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70
Original Poster
Rep:
|
- In Fedora 3 and Redhat 9:
changing DIR_COLORS has no effect (both after exiting hello and logging out ) -- you have to copy this file to $HOME/.dircolors for it to have any effect
- In Suse 8.0:
changing DIR_COLORS takes effect the next time you enter the shell
I am using these all in GUI modes, in vmware environments.
OK, well, that's interesting. Thanks for your help.
|
|
|
06-22-2009, 08:58 AM
|
#8
|
LQ Newbie
Registered: Jun 2009
Posts: 1
Rep:
|
In red hat 5 I noticed two files in /etc directory.
DIR_COLORS
DIR_COLORS.xterm
|
|
|
05-12-2011, 08:34 PM
|
#9
|
LQ Newbie
Registered: May 2011
Posts: 3
Rep:
|
DIR_COLORS.xterm
Make the changes in DIR_COLORS.xterm for Fedora / Redhat.
Last edited by nlsteffens; 05-16-2011 at 11:24 PM.
|
|
|
04-13-2012, 03:41 AM
|
#10
|
LQ Newbie
Registered: Sep 2009
Posts: 23
Rep:
|
run: type ls
if it returns : ls is aliased to `ls --color=tty'
run: unalias ls
|
|
|
04-13-2012, 07:29 AM
|
#11
|
Senior Member
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,638
Rep: 
|
Do you know how old this thread is? Why not let is rest in peace?
|
|
|
12-01-2012, 09:03 AM
|
#12
|
LQ Newbie
Registered: Nov 2012
Posts: 9
Rep: 
|
|
|
|
All times are GMT -5. The time now is 07:11 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|