3
votes
2answers
374 views

How to highlight a word in the output of “cat”? [duplicate]

I can do the following to see if some word is available in the output of "cat": cat filename | grep word This filters the output and shows only those lines which contain "word". Now, is it possible ...
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 ...