Author Topic: bash Question  (Read 1131 times)

LorKorub

  • Member
  • **
  • Posts: 175
  • Kudos: 0
bash Question
« on: 24 January 2003, 11:56 »
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?
"American English -- the noble language of your superiors"

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
bash Question
« Reply #1 on: 24 January 2003, 12:28 »
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 ]

Someone please remove this account. Thanks...

LorKorub

  • Member
  • **
  • Posts: 175
  • Kudos: 0
bash Question
« Reply #2 on: 24 January 2003, 13:20 »
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?
"American English -- the noble language of your superiors"

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
bash Question
« Reply #3 on: 24 January 2003, 13:33 »
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.
Someone please remove this account. Thanks...

LorKorub

  • Member
  • **
  • Posts: 175
  • Kudos: 0
bash Question
« Reply #4 on: 24 January 2003, 17:37 »
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!
"American English -- the noble language of your superiors"

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
bash Question
« Reply #5 on: 25 January 2003, 00:41 »
On the link that you originally quoted of the man page that said Debian ignored the /etc/DIR_COLORS files was a link to the dircolors command which I assumed you already looked at. That is where it mentioned the "LS_COLORS" environment variable which is why I asked about it...
Someone please remove this account. Thanks...

LorKorub

  • Member
  • **
  • Posts: 175
  • Kudos: 0
bash Question
« Reply #6 on: 25 January 2003, 11:15 »
Yes, it did list dircolors on that page, but then it talked about /etc/DIR_COLORS, and all of the other files.  It had a link to the dircolors man page, but it threw me off at the bottom when it talked about Debian ignoring config files.  Actually, I searched a bunch of debian.org's mailing list archives, and many people were having the problem of making a /etc/DIR_COLORS file, and not having it work.

So, in short, that page was just kind of confusing. Add three hours of sleep the night before, and a 12-pack to the mix, and you equate to my mindframe at the state  :D
"American English -- the noble language of your superiors"

TheQuirk

  • VIP
  • Member
  • ***
  • Posts: 2,154
  • Kudos: 315
bash Question
« Reply #7 on: 27 January 2003, 02:26 »
quote:
Originally posted by X11: PM ME FOR CYBER:
Gleb you ugly barsted, FAQ this.


FAQ too.