Solved

the color of files....

Posted on 2003-12-10
5
395 Views
Last Modified: 2013-12-16
Hello Experts,

     I am in redhat .... I guess 9.x ?! For some reason, the setting makes different kinds of files having different colors. The *.tex file is yellow .... so light that I can barely see it ! How do I change the colors of those files (I mean the file name when we do "ls") ..... I hope I asked the questions in the right category ..... Thanks very much !!!

meow .....
0
Comment
Question by:meow00
  • 3
5 Comments
 
LVL 5

Expert Comment

by:arjanh
ID: 9914309
On my system it is at /etc/DIR_COLORS
You can edit that file or create a personal .dir_colors file in your home directory
0
 
LVL 1

Author Comment

by:meow00
ID: 9914405
Hello,

    Thanks for the answers .... but I still can not fix it yet. The following is my /etc/DIR_COLORS. However, I didn't see ".tex", so how do I change it ? Also, what does it mean by "01:32" ???? Help ! and Thanks a lot !!!

meow....
--------------------------------------------------------------------
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
.cmd 01;32 # executables (bright green)
.exe 01;32
.com 01;32
.btm 01;32
.bat 01;32
.sh  01;32
.csh 01;32
.tar 01;31 # archives or compressed (bright red)
.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
.bz  01;31
.tz  01;31
.rpm 01;31
.cpio 01;31
.jpg 01;35 # image formats
.gif 01;35
.bmp 01;35
.xbm 01;35
.xpm 01;35
.png 01;35
.tif 01;35
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9914509
Try adding a new line for .tex (it currently probably is using some default value)

from http://www.balug.org/pipermail/balug-talk/2002-November/000791.html :

/etc/DIR_COLORS
is a configuration file that controls the global color settings for the ls
command.

/etc/DIR_COLORS can be copied into a /home/$HOME/.dir_colors and modified
there to overide /etc/DIR_COLORS for the user of $HOME.

The selection of colors in those two config files seems to be limited to
0 black
1 red
2 green
3 yellow
4 blue
5 magenta
6 cyan
7 white

For each file item designated a foreground and a background color may be set.
Foreground colors are indicated by a leading 3 and background colors by a
leading 4 and ; is the separator. # starts a comment.

Also, a text style may be set:
00 none
01 bold
04 underscore
05 blink
07 reverse (I guess this inverts the fg color with the bg color)
08 concealed
01 underline

Example:

DIR      01;40;36      #directories: bold text, black bg, cyan

I have found the colors green, yellow, cyan, white and (somewhat) magenta
show up better against black than blue or red do against black. Oddly, when I
indicate 43 or 33 (yellow bg or yellow fg) I get white on my PPC system.
Don't know why. Also, I tried 04 to underscore directories but it didn't work.

Changes to DIR_COLORS do not take affect until X11 is restarted or, in the
case of non-X11 terminals, until I re-spawn the tty by killing its process
(kill ####). I do a ps command to find the tty process # to kill. Or reboot,
but rebooting is tedious.

0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 20 total points
ID: 9914842
the environment variable LS_COLORS seems to be your friend
it contains, sparated by : (colon), what you see in DIR_COLORS, except that extension and valu is separated by =
like:
  LS_COLORS=no=00:fi=00:di=01;34:ln=01
and so on ..
0
 
LVL 5

Accepted Solution

by:
arjanh earned 130 total points
ID: 9916098
The LS_COLORS environment variable is generated from the DIR_COLORS file. If I change that file and login again (or reload the /etc/profile), the changes in the DIR_COLORS file are present in the LS_COLORS env var.

On my system the .tex files are just shown white text on black, which is the default. But by adding e.g.
.tex 01;47
they become bold red, which is very well visible :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux Mint 18 31 76
VMWare 6 crashing 14 97
What language/protocol is the Angular Chat? 2 55
Hacked File Timestamps 4 49
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now