Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2002 10:52:19 -0700 (PDT)
From:      Dave McCammon <davemac11@yahoo.com>
To:        freebsd-questions@FreeBSD.ORG
Cc:        Turaj Shabestary <turaj@elmagn.chalmers.se>
Subject:   Re: colored listing
Message-ID:  <20020425175219.21605.qmail@web14810.mail.yahoo.com>
In-Reply-To: <1019682631.438.0.camel@turtle.lewiz.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--- lewiz <purple@lewiz.info> wrote:
> Err,
> 
>   ls -FGa should give you color, /s after dirs and
> show hidden files.
> 
> -lewiz.
> 
> On Wed, 2002-04-24 at 22:24, Dan Nelson wrote:
> > In the last episode (Apr 24), Turaj Shabestary
> said:
> > > Hi,
> > > 
> > > Would you please tell me how can I set different
> colors to different type of 
> > > files when using 'ls -G' I can make the default
> coloring but I don't have 
> > > control on different types of file. For instance
> *.cpp with some color an *.jpg 
> > > with another color. It is possible in solaris
> but how can be done in FreeBSD?
> > 
> > If you can see colored ls listings on solaris,
> it's because you
> > installed a custom ls.  Install the same package
> on FreeBSD :)
> > 
> > Try the misc/gnuls or misc/colorls ports.
> > 

Spent some time on this yesterday.
This is what I could get to work.
Using tcsh
put in ~/.cshrc(or ~./tcshrc or /etc/csh.cshrc)

setenv TERM cons25
setenv LSCOLORS exfxbxdxcxegedabagacad

(man ls for color scheme above..I modified it from the
default...man ls shows default.)

also but aliases in the ~/.cshrc or ~/.tcshrc
alias ls ls -G
alias la ls -Ga
alias ll ls -Gla
etc
This gave me colored ls output.
you can also use setenv TERM xterm-color (xterm
users?)
but this gave me some minor problems with vi.
The above (LSCOLORS) allows you to modify default
colors but doesn't allow you to set specific colors
for certain file types...as far as I can tell, anyway.

The man page for tcsh says that you can use the 
LS_COLORS environment variable to change file color
type but I couldn't get it to work.

Anywho...this may not be exactly what you were looking
for but I hope it helps in some way.



__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

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?20020425175219.21605.qmail>