SGI: Development

Colourising GNU ls

Hey All,

Finally got round to installing a colourising ls. Here's the recipe:


0. get GNU coreutils 6.12 from http://ftp.gnu.org/gnu/coreutils

1. compile all of it:

CC=c99 CFLAGS="-O2 -mips4" ./configure

but install only the ls binary from $SRC/src

2. nedit $HOME/.Sgiresources:

winterm*background: #000020

3. nedit $HOME/.bashrc:

LS_COLORS='di=35:ln=36:ex=32:'
export LS_COLORS

alias ls='/your/installation/path/ls --color'

4. Log out/in to have it all take effect.


Enjoy :)
:Fuel: redbox 800Mhz 4Gb V12
I do it just a tad differently, I use both gnu ls and gnu dircolors, and I put it in my ~/.profile so it's always in effect:

Code: Select all

ls ()
{
command /your/installation/path/ls --color -F "$@"
}

set LS_COLORS
eval `/your/installation/path/dircolors -b`
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:
If you use tcsh, it has a built-in colorized ls (the actual command is ls-F, but you can assign aliases to it). I think bash does too.
:PI: :O2: :Indigo2IMP: :Indigo2IMP:
robespierre wrote: If you use tcsh, it has a built-in colorized ls (the actual command is ls-F, but you can assign aliases to it). I think bash does too.

Well I use bash exclusively and the only way I was able to see color ls on any of my Suns or SGI's was by using the GNU ls and dircolors on them, as I detailed above. Also, on my Octane doing man sh | grep-i color gives nothing... :x
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:
I will freely admit I could be wrong :)
:PI: :O2: :Indigo2IMP: :Indigo2IMP:
On my Octane, if I do man tcsh | grep -i color it says "George Hartzell, MCD Biology, University of Colorado-Boulder, 1988" :shock:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:
robespierre wrote: I will freely admit I could be wrong :)

But maybe not in this case ... -F is fine but you still have to tell tcsh what color to apply to what filetypes ...

http://docstore.mik.ua/orelly/unix3/upt/ch08_06.ht

weaselwords ; I din't try this. White on blue is about all my brain can deal with.
The time has come for someone to put his foot down ...
vishnu wrote: On my Octane, if I do man tcsh | grep -i color it says "George Hartzell, MCD Biology, University of Colorado-Boulder, 1988" :shock:

I think the color features were added sometime between tcsh 3.x.x (is that the version in 6.5?) and 6.x (Astron). It could also be that piping man into grep doesn't really work, since the troff graphic control chars interfere with searchability.
(is it really c^Ho^Hl^Ho^Hr?)
:PI: :O2: :Indigo2IMP: :Indigo2IMP: