Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jun 2002 20:30:37 -0700 (PDT)
From:      Annelise Anderson <andrsn@andrsn.stanford.edu>
To:        Mike Flanagan <mikenoc@mindspring.com>
Cc:        freebsd-newbies@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG
Subject:   Re: getting colors to work with ls
Message-ID:  <Pine.BSF.4.10.10206102020370.28996-100000@andrsn.stanford.edu>
In-Reply-To: <007701c210f3$26f6efd0$ecfea8c0@monkey>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Jun 2002, Mike Flanagan wrote:

>  Hello all,
> 
>  I am trying to use colors with ls. Reading the man pages for ls shows that you
> can use ls with a -g and then a number like 9 to specify directory and such. 
> I have tried using this in every combination and cannot seem to get colors to
> work. Can anyone please tell me how to do this ?

It's ls -G, not ls -g

The foreground and background and controlled by vidcontrol (on 
the console).  Other kinds of files are shown in accordance with
the settings of the environmental variable LSCOLORS. So it is not
just "one number."

I have a file called milcol that looks like this:

vidcontrol blue brown
LSCOLORS=0x7x6x5x1x46x201060203

and one called pastel that looks like this:


vidcontrol white black
LSCOLORS=2x5x0x4x6x464301060203
export LSCOLORS

These could be shell scripts but I just use the built-in
bash source command.  The / directory is a good one to check
(ls -G /) because it has files of different kinds.

To return to sanity:
vidcontrol white black
LSCOLORS=

With remote access, you need something other than vt100 as a
terminal emulator, as vt100 is not color-capable.  xterm-color
will work.

	Annelise
-- 
Annelise Anderson
Author of: 		 FreeBSD: An Open-Source Operating System for Your PC
Available from:	 BSDmall.com and amazon.com
Book Website:    http://www.bittreepress.com/FreeBSD/introbook/	




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10206102020370.28996-100000>