Colorifer logo
Colorifer is set ofš utilities to color output of other processes, e.g. command line utilites or compilers. These programs make output more readable using different color for the significant pieces of the text.š For example, you can use it to replace the color-gcc script or to colorize system logs. You only need to create new config - set of the patterns (regular expressions) and colors you want.
Colorifer project is divided into two parts:


CSedš is a color stream editor. It works like sed, but don't edit stream and made color
substitutions instead. This is a simple filter, you can use to colorize output of any program.

Csed supports all sed like address types: '/REGEX/', 'NUMBER', 'FIRST~SEP', 'START,STOP', 'START,+NUMBER', 'START,~NUMBER'
You can also append '!' character to the end of an address specification to negate the sense of the match.

To colorize whole string use '[address] p color[,attribute]' command with address specification,
You can also use 's/REGEX/color[,attribute]/' command to colorize multiple substrings.

For example:
ššš $echo "test1:test2"|csed '/([a-z0-9]+):/ p blue'
ššš test1:test2
See screenshot here.

CSed is also an interesting for learning sed, and regular expressions.

Colorifer is a wrapper to run program and colorize it's output.
It works like "some-program 2>&1|([ -f some-file] && csed -f some-file)"
command, but also return exit code of program and don't mix stdout and stderr of the program. Colorifer's config is a set of Csed's commands.

Pcolorize is a srcipt to setup colorifer wrapper. For example, if you want to colorize gcc and g++ type:
šššš $pcolorize gcc g++
This script will creates two shell scripts in you $HOME/bin directory.

How to colorize ps system utility?

ššš $ cat>~/bin/ps <<EOF
ššš > #!/bin/sh
ššš > PATH=/bin:/usr/bin
ššš > ps "\$@" |csed '1 p yellow,bold' 's/^[[:space:]a-z]*(\d+)/red/'
ššš > EOF
ššš $ chmod +x ~/bin/ps
ššš $ ps
š ššš PID TTYššššššššš TIME CMD
šššš 6826 pts/1ššš 00:00:00 bash
ššš 10254 pts/1ššš 00:00:00 ps
ššš 10255 pts/1ššš 00:00:00 ps
ššš 10256 pts/1ššš 00:00:00 csed

Download latest version of colorifer here.

Colorifer is written by Stanislav Ievlev and Alexey Voinov

Hosted by
SourceForge Logo