Subject: Debian Color-ls Command?

From: Chris Westwood <[email-masked]>
Date: Fri, 30 Aug 1996 19:51:11 +0000

This may be one for the Debian FAQ--apologies in advance if you've been
there before--but I haven't seen an answer to it yet.

I switched from Slackware (2.3) to Debian just a couple of days ago, and
can't seem to get color (that's *colour* here in the UK) listings by
default. Simply typing "ls" gives me the standard white on black, but I'd
really like to be able to distinguish at a glance between files and
directories etc. Using the "color-ls -o" command is the only way I can
achieve this, and even then the colors are ugly defaults, ignoring the
settings in /etc/DIR_COLORS. (These dircolors settings are displayed
verbosely on log in, by the way.)

So far I've installed the base package, basic TCP/networking, GCC and so
on, ane everything's gone without a hitch. Checking the package details in
Dselect, it doesn't seem that color-ls is dependent on anything I haven't
already installed.

I may be overlooking something obvious, but are there any settings/files I
need to edit to get what I want? Color's the only thing I'm missing since
switching from Slackware. In everything else, I'm delighted.

Thanks in advance for any help you can give.

Cheers,

Chris

---

From: Syrus Nemat-Nasser <[email-masked]>
Date: Fri, 30 Aug 1996 13:13:31 -0700 (PDT)

> verbosely on log in, by the way.)
[SNIP] 
> switching from Slackware. In everything else, I'm delighted.

This is a now a FAQ because of a recent change:

With the integration of color-ls directly into the fileutils
package, a few things have changed.  dircolors no longer sets
up aliases or shell scripts to colorize ls, dir, and vdir.

Here is an excerpt from a .bashrc which sets up aliases after
running dircolors:

	# set up color-ls
	eval `dircolors /home/syrus/.dir_colors`
	alias d='ls -F --color=auto'
	alias v='ls -l --color=auto'
	alias vdir='ls -l --color=auto'
	alias dir='ls -F --color=auto'                                                 

Note that color=tty has been changed to color=auto.  See the
documentation for other change information.

Cheers.  Syrus.

----------------------------------------------------------
Syrus Nemat-Nasser <[email-masked]>    UCSD Physics Dept.

---

From: Chris Westwood <[email-masked]>
Date: Sat, 31 Aug 1996 14:27:21 +0000

>documentation for other change information.

Hi Syrus,

In fact the above didn't work for me either--dumped core the first time I
used 'ls' after that! Had a hell of a time trying to figure it out.In fact
the new way of doing things (at least in my case, and by new I mean Debian
1.1) isn't to rely on /etc/DIR_COLORS, as color-ls and dircolors don't seem
to read it! What I had to do was run dircolors, monitor its output, then
copy this into my profile (/home/cw/.bash_profile). This is what finally
did the trick:

*** Excerpt from .bash_profile ***

# set up color-ls
LS_COLORS='di=1;34:bd=40;33;1:ln=1;36:cd=40;33;1:ex=1;32:*.tar=1;31:*.tgz=1;31:*.gz=1;31:'
export LS_COLORS;
LS_OPTIONS='--8bit --color=tty -F';
export LS_OPTIONS;
alias ls='/usr/bin/color-ls $LS_OPTIONS ';
alias dir='/usr/bin/color-ls $LS_OPTIONS --format=vertical';
alias vdir='/usr/bin/color-ls $LS_OPTIONS --format=long';
alias d=dir;
alias v=vdir;

Of course, for all I know this could the *old* way of doing things, but it
works! Now I'm happy. Many thanks to all who responded.

Cheers,

Chris