Code Monkey home page Code Monkey logo

colorize's Introduction

colorize

Log colorize pipe filter.

This repo is resurrection of Daniel Flinkmann's colorize.pl from http://www.Flinkmann.de (site is not working anymore). Latest colorizer page snapshot is available at wonderful archive.org but without colorize-0.3a.tgz file.

How to Install

Single Users

Just copy the colorize.pl into your own ~/bin/ binary directory.

Administrators

For Administrators who want to offer this tool systemwide, please copy colorize.pl to /usr/local/bin or any other systemwide available directory.

How to use

Use any kind of <stdin> text stream with a pipe.

ls -lF | colorize.pl [options]

colorize.pl will print out every line from <stdin> to <stdout>. Rows with matching strings will be colorized with your choice of color.

colorizing whole rows

Just start colorize string with minus character.

Standard Options format:

-<style><foreground><background>:<searchstring>

Quick colorisation Options format:

-:<searchstring>

colorizing single words

Just start colorize string with plus character:

Standard options format: +<style><foreground><background>:<searchstring>

Quick colorisatoin options format: +:<searchstring>

Parameters:

<style>

n = normal, l = light, u = underscore, i = inverted, b = blinking

<foreground color>

0 = black, 1 = red, 2 = green, 3 = yellow, 4 = blue, 5 = purple, 6 = cyan, 7 = white

<background color>

0 = black, 1 = red, 2 = green, 3 = yellow, 4 = blue, 5 = purple, 6 = cyan, 7 = white, 8 = no background

<searchstring>

string (or regular expression)

Examples

cat output-logfile.txt |colorize.pl -u17:error -n37:warning -b10:funny

will colorize lines with the word:

  • "error" underscored in red front color and white background
  • "warning" in green front color and white background
  • "funny" blinking in red front color with black background

cat output-logfile.txt |colorize.pl -:error -:warning -:funny

will colorize lines with the word:

  • "error" in the first preset color set
  • "warning" in the second preset color set
  • "funny" in the third preset color set

cat output-logfile.txt |colorize.pl +:warning

will colorize just the word "warning" with the first preset color set.

cat output-logfile.txt |colorize. pl +u18:error

will colorize just the word "error" red with no background and underscore it.

cat output-logfile.txt |colorize.pl +:'\t' +:' '

will colorize all TABs (regular expression '\t') and all Spaces ' ' into different colors. (Great for space/tab sensitive configs like sendmail etc.)

cat output-logfile.txt |colorize.pl +:'\d'

will colorize all digits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.