Colourising GNU ls

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
jimmer
Donor
Donor
Posts: 483
Joined: Tue Oct 12, 2004 3:54 pm
Location: London, Ingerlund

Colourising GNU ls

Unread postby jimmer » Sun Nov 22, 2015 3:05 pm

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
:O2: bluebox 200Mhz 256Mb AV1+O2Cam

User avatar
vishnu
Donor
Donor
Posts: 3189
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: Colourising GNU ls

Unread postby vishnu » Sun Nov 22, 2015 5:03 pm

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:

robespierre
Posts: 1579
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: Colourising GNU ls

Unread postby robespierre » Sun Nov 22, 2015 8:03 pm

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:

User avatar
vishnu
Donor
Donor
Posts: 3189
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: Colourising GNU ls

Unread postby vishnu » Sun Nov 22, 2015 11:27 pm

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:

robespierre
Posts: 1579
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: Colourising GNU ls

Unread postby robespierre » Mon Nov 23, 2015 12:55 am

I will freely admit I could be wrong :)
:PI: :O2: :Indigo2IMP: :Indigo2IMP:

User avatar
vishnu
Donor
Donor
Posts: 3189
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: Colourising GNU ls

Unread postby vishnu » Mon Nov 23, 2015 11:41 pm

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:

User avatar
hamei
Posts: 10435
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

Re: Colourising GNU ls

Unread postby hamei » Tue Nov 24, 2015 4:56 am

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.
I spent a fortune on booze, birds, and fast cars ... the rest I just squandered

robespierre
Posts: 1579
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: Colourising GNU ls

Unread postby robespierre » Tue Nov 24, 2015 12:46 pm

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:


Return to “SGI: Development”

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests