From: Jerry McBride
Since Caldera failed to include DIRCOLORS in it's fileutils*.rpm, I have figured out a way to implement colored directory listings using dircolors from other "donor" distributions. :')
This text is a very brief "HOT-TO" to get LS or DIR coloration setup on Caldera OpenLinux 2.3. I specify that version of Linux, because I know it works there! Also, since I'm a BASH freak, it's assumed you are also using BASH for your Konsole shell...

Things needed:

Since COL 2.3 DID NOT ship with needed "dircolors" utility, so you'll have to go grab one from another Linux distribution. The RPM you're looking for is:


I used the one from RedHat. Any of the later versions will work just fine. All you'll need from this package is the "dircolors" program. Unfortunitely, you'll have to install the whole rpm, to get just that one program.

Not a problem. :')
How to unpack the RPM:

From Konsole, go to the directory where you downloaded the rpm to.
Execute: rpm -Uvh --nodeps --force fileutils-4.0-8.i386.rpm
Once the install is completed you can optionally re-install the Caldera Open Linux 2.3 version of that rpm or just run with the RedHat pieces. It's up to you.

How to set it all up:

From the same Konsole, execute: /usr/bin/dircolors -p
If dircolors is installed correctly, dircolors will print to console the internal defaults. Now what you need to do is to get these defaults into a file.
So execute: /usr/bin/dircolors > ~/.dircolors
This will pipe the information to a text file located in the /root directory. Now using your favorite command line text editor, edit that file to reflect your desired color settings. Don't worry about SCREWING that file up, as you can generate a new copy anytime you need one by using the above command. All the information you need to set the colors will be found in that file. So take a few moments and try to understand what it is you are doing... :')

Now, to implement your color scheme in the current Konsole.
Execute: eval `dircolors -b ~/.dircolors`

NOTE: The character before the dircolors program name is the one BELOW the "~" tilde character on the keyboard. What the name for this character is, I dunno, but it HAS to be that one. Also, note the "-b" switch. It specifies that you are using the BASH shell. :')

<Editor: The writer of the StepByStep is referring to the '`'  backquote charcater.>
If the command executes correctly, you won't see anything printed to the screen. The only thing that will happen is a new prompt will appear below the executed line. It will appear that nothing was done and that's EXACTLY what you want. :')

Now for colors... execute either dir --color or ls --color and you will see COLOR! Not just COLOR, but custom colors! It won't look pretty until you pick out the colors you like and possibly change the options for Konsole. In Konsole, under "schemes" I picked black back ground with white text and it looks pretty good. In a REAL console, it looks even better. Now at a glance, I can separate the executables from directories... :')


- To change colors edit ~/.dircolors.
- To implement colors in the current Konsole execute: eval `dircolors -b ~/.dircolors`
- To use the colors add the "--color" switch to the invocation of LS or DIR.

How to make it permanent?

To add coloration to your shell, each and everytime you start a shell, you'll have to add a few lines of text to your shell startup script. Since I use BASH, I edited /etc/config.d/shells/bashrc and added the following three lines to the end of the script:

eval `/usr/bin/dircolors -b ~/.dircolors`
alias dir='dir --color'
alias ls='ls --color'

Now I have colored directory listings, everytime I'm in a Konsole... Whay cool! Even better, if I choose to not run KDE, I have terrific looking consoles!

Here's a sample dircolors file:

# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.

# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.

# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM xterm
TERM vt100

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 01;34 # directory
LINK 01;36 # symbolic link
FIFO 40;33 # pipe
SOCK 01;35 # socket
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file

# This is for files with execute permission:
EXEC 01;32

# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')

# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32 01;32
#.btm 01;32
#.bat 01;32

.tar 01;31 # archives or compressed (bright red)
..tgz 01;31
..arj 01;31
..taz 01;31
..lzh 01;31 01;31
..z 01;31
..Z 01;31
..gz 01;31
..deb 01;31
..png 01;35 # image formats
..png 01;35
..bmp 01;35
..ppm 01;35
..tga 01;35
..xbm 01;35
..xpm 01;35
..tif 01;35
..mpg 01;37
..avi 01;37 01;37
..dl 01;37

searchSearch Index