You are not logged in.

#1 2004-12-18 19:09:26

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 546
Website

Coloring directories and files under a terminal?

Hi everyone,

I know, and have the option running, that with the ls --color=auto i get colored files, but... i want to be able to colour my self the different type of files, (like brown for zip, tgz and such, blue for avi, mp3, ogg... see the idea?)

Does anyone have a clue on how to acomplish this?


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#2 2004-12-18 22:01:48

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Coloring directories and files under a terminal?

On some systems you can just edit /etc/DIR_COLORS

Arch appears to use a binary program /bin/dircolors. Running that produces this output:

~)$ dircolors
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:
bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:
*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:
*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:
*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:
*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:
*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:
*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
export LS_COLORS

You could trying setting LS_COLORS in your .bashrc file and make the appropriate changes.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2004-12-18 23:56:34

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: Coloring directories and files under a terminal?

cactus wrote:

On some systems you can just edit /etc/DIR_COLORS

Arch appears to use a binary program /bin/dircolors.

the normal way to use dircolors is this:

make a /etc/DIR_COLORS and add to your /etc/profile at the end this

eval `dircolors /etc/DIR_COLORS`

if you need a template for /etc/DIR_COLORS, here is mine:

http://daperi.home.solnet.ch/linux/etc/DIR_COLORS


The impossible missions are the only ones which succeed.

Offline

#4 2004-12-19 18:29:34

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 546
Website

Re: Coloring directories and files under a terminal?

Thanks a lot both, ill be giving it a try as soon as i can.

thanks again!


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#5 2004-12-20 05:52:02

dk
Member
Registered: 2004-04-20
Posts: 106

Re: Coloring directories and files under a terminal?

I just took dp's DIR_COLOR template saved it as

~/.dircolors

Then in my .bashrc file I added

eval `dircolors -b ~/dircolors`

just above alias ls='ls --color=auto'

Be sure to edit/add your TERM in ~/.dircolors

I use aterm so I added

TERM rxvt

That was kind of a gotcha..I guess aterm uses rxvt

Offline

Board footer

Powered by FluxBB