domingo, janeiro 23, 2005

Improving multi-terminal usage using colors

I am generally with many terminals opened, and at least in one of them i'm root. What i wanted to do for a long time was being able to use colors to ease differing from a root terminal from a 'myself' terminal. To do that i edited root's .bashrc, so that it would color the shell red, and .bash_logout to restore default terminal color. Unfortunatelly, live is not that easy. So, some applications spoil my coloring of the font. One of them is specially used: ls. Therefo.re, i had to find a way to stop it from doing so. My poor solution was to create a shellscript lsfred (kept in /usr/local/bin) that called ls with command line parameters and recolored my line. After that, i aliased ls=lsfred.
Don't bother an extra line after the ls... Thats an echo effect.

To get it working, download this and save it as /root/.bashrc and then this and save as /root/.bash_logout. Download this and save as /usr/local/bin/lsfred.

That's all.

[ ]'s
fred