0
votes
1answer
25 views

Highlight patterns in command output (grep-like but without excluding lines) [duplicate]

I need a command that colorizes some symbol sequence in output of a certain command. I'd like it like grep make it. $ some-command | grep symbol-sequence However grep removed lines that isn't ...
9
votes
3answers
393 views

syntax_highlight <source_file> | lpr

Does anyone know of a simple way to produce the PostScript corresponding to a syntax-highlighted version of a source file that can be piped directly to a PostScript printer? As the wording of the ...
20
votes
2answers
3k views

How can I display syntax highlighting on a file?

Is there a variant of cat that outputs syntax-highlighted lines of code when used on a source file? An idea: maybe vi[m] or another editor can be asked to dump the syntax-highlighted contents of said ...
76
votes
12answers
23k views

How to have tail -f show colored output

I'd like to be able to tail the output of a server log file that has messages like: INFO SEVERE etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I ...