![]() |
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. |
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. |
- 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. |
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" ]Hope this helps. |
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? |
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). |
- 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. |
In red hat 5 I noticed two files in /etc directory.
DIR_COLORS DIR_COLORS.xterm |
DIR_COLORS.xterm
Make the changes in DIR_COLORS.xterm for Fedora / Redhat.
|
run: type ls
if it returns : ls is aliased to `ls --color=tty' run: unalias ls |
Do you know how old this thread is? Why not let is rest in peace?
|
Here is a good answer:
http://www.geekgumbo.com/2011/11/04/...he-bash-shell/ |
| All times are GMT -5. The time now is 10:20 PM. |