Operating Systems > Linux and UNIX
bash Question
LorKorub:
I am using Aterm with a "transparent" background with a blueish sort of look to it. The problem I am having is that in bash, all of my directories are colored blue in my aterm, andit makes them very hard to see. How would I go about changing them to a different clor, like white?
voidmain:
Actually what you want to change are the "ls" colors. See /etc/DIR_COLORS and /etc/DIR_COLORS.xterm. They're text files where the colors are defined. You'll need an ANSI reference.
[ January 24, 2003: Message edited by: void main ]
LorKorub:
Thanks void main.
I am using Debian, and those two files don't exist. According to this page, they are ignored by Debian.
Any way to find a workaround to this?
voidmain:
Do you have an environment variable set called "LS_COLORS"? Type "set | grep COLOR" and see what you get, or "echo $LS_COLORS". You may have to set the environment variable in your /etc/profile or your user .bashrc.
LorKorub:
Thanks void..
I figured out how to do it, just in case anyone cares.
You have to use the program /usr/bin/dircolors, and point it to a config file that you want to use as your colors. The config file is all ANSI, but it is explained pretty well if you read the man page.
First, find your default shell.
# echo $SHELL (this should be set to bash, if you are using most major distros of Linux)
If you have bash, you can run dircolors with no options, as bash is the deafult.
Next, run:
dircolors --print-database | more
This should explain everything quite easily for you. It will show your your current color scheme, and even give you the ANSI code that you can use to change it.
Next, make a config file that you would like to point dircolors at, e.g., /etc/dir_colors (you can call it anything...you can call it piss if you want to)
Then, do things the easy way:
dircolors --print-database > /your/config/filename
Go in and edit your config file to your heart's content. You may have to enter in a TERM variable if you are using a non-standard terminal, like me, who is using aterm. Just follow the format.
Last, edit /etc/bash.bashrc to include this line somewhere in the file (this is for bash/bash compatibles. If you are using csh, you would use option -c...read the dircolors man page):
eval `dircolors -option /your/config/filename`;
Of course, if you want to keep it user specific, edit ~/.bashrc instead of the system wide /etc/bash.bashrc.
Restart your terminal.
Have fun!
Navigation
[0] Message Index
[#] Next page
Go to full version