Skip to main content
colorex is a powerful console tool that displays files highlighting some patterns with colors
Copyright (C) 2011 http://www.scopart.fr

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.txt.

Installation
============
if you haven't setuptools installed you can just copy the "colorex" script into your path (eg: /usr/local/bin)
don't forget to check that colorex is executable.

else:
python setup.py install

Usage
=====
colorex [options] [file1] [file2] ...

Display files or sdtin with pretty colors for matched patterns. if you don't specify
files, stdin is used.

Options
=======
--version show program's version number and exit
--help, -h show this help message and exit
--blue=BLUE, -b BLUE display BLUE pattern in blue
--red=RED, -r RED display RED pattern in red
--green=GREEN, -g GREEN display GREEN pattern in green
--yellow=YELLOW, -y YELLOW display YELLOW pattern in yellow
--magenta=MAGENTA, -m MAGENTA display MAGENTA pattern in magenta
--cyan=CYAN, -c CYAN display CYAN pattern in cyan
--bblue=BBLUE, -B BBLUE display BBLUE pattern in blue background
--bred=BRED, -R BRED display BRED pattern in red background
--bgreen=BGREEN, -G BGREEN display BGREEN pattern in green background
--byellow=BYELLOW, -Y BYELLOW display BYELLOW pattern in yellow background
--bmagenta=BMAGENTA, -M BMAGENTA display BMAGENTA pattern in magenta background
--bcyan=BCYAN, -C BCYAN display BCYAN pattern in cyan background
--blink=BLINK, -K BLINK display BLINK pattern blinking (not widely supported)
--bold=BOLD, -D BOLD display BOLD pattern in bold
--undrln=UNDRLN, -u UNDRLN display UNDRLN pattern underlined
--bisounours, -N display with random colors

Regular expressions are interpreted, so if you want to match a '*' or a '[' or any element of the regexp grammar
you have to escape it with a backslash.

Examples
========
to display every word "ERROR" in red of foo.txt, type:
colorex --red ERROR foo.txt

to watch logfile.txt displaying "WARNING" in yellow and "INFO" in green:
tail -f logfile.txt | colorex -y WARNING --green INFO
exit with CTRL c

to display "(" and ")" contained in foo.txt in blue:
colorex -b '\(|\)' foo.txt

to diplay in red "FATAL" or "ERROR" and strings like [1234] or [4567] with red background, just type:
colorex -r 'ERROR|FATAL' -R '\[[0-9]{4}\]'

another case:
tail -f /var/log/syslog | colorex -G '[0-9]{2}:[0-9]{2}:[0-9]{2}' -b $(hostname) -M '\[[0-9]{1,5}\]' -y root

Release files for colorex 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colorex 2.0
File Size Uploaded
colorex-2.0.tar.gz 4.2 kB Details

Release files / colorex-2.0.tar.gz

Download URL colorex-2.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6893d03698bec64a8010786f7b484464ccb18596e93e78ed4fae507ff51ff481
BLAKE2b-256 checksum
How to use checksums
9c8a8c941536d6f6586a15467f7c891b29333745aff70ef2e7f1b55b4459a354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page