Re: [SLUG] bash profile

From: Ian Blenke (icblenke@nks.net)
Date: Mon Mar 22 2004 - 11:27:59 EST


Eben King wrote:
> On Sat, 20 Mar 2004, Kwan Lowe wrote:
>
>
>>>How do I change my bash color scheme? And can I specify different colors
>>>for different file types (dirs/executables/hidden)?
>>
>>You need to set the LSCOLORS environment variable. I don't have a reference
>>handy, but googling should bring up a few hits.
>>
>>http://linux-sxs.org/housekeeping/lscolors.html
>
>
> That might come from the file /etc/DIR_COLORS .

To source the dircolors config into your current shell, merely eval the
output of dircolors:

In a bourne shell (sh/ksh/bash/...):
        $ eval `dircolors -b`

In a C shell (csh/tcsh/...):
> eval `dircolors -c`

Note the backticks.

Your ls is probably already aliased to autodetect its invocation to use
color or not, ie:

        $ alias ls
        alias ls='ls --color=auto '

To force color output, you can always use "ls --color=yes".

To view the entire dircolors config, try the -p flag:

        $ dircolors -p

You can dump the config to a file, and use it to source your environment
later:

        $ sudo dircolors -p > /etc/DIR_COLORS
        
        $ eval `dircolors -b /etc/DIR_COLORS`

Or, if you want to work a user private configuration into your
environment, you can add the eval to the end of your shell profile.

        $ dircolors -p > $HOME/.dircolors
        $ echo 'eval `dircolors -b $HOME/.dircolors`' >> ~/.profile

(remembering the order of invocation of your shell's profile)

-- 
- Ian C. Blenke - Director of Service Delivery <icblenke@nks.net>
(This message bound by the following:
http://www.nks.net/email_disclaimer.html)
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:34:35 EDT