Is there a method to colorize the output of cat
, the way grep
does.
For grep
, in most consoles it displays a colored output hi
From late April 2018 onwards:
Bat - A cat(1) clone with syntax highlighting and Git integration.
The project is a cat clone with support for colors and customizations written in Rust. It offers not only syntax highlighting with multiple themes, but also Git integration. As described in the documentation:
bat tries to achieve the following goals:
- Provide beautiful, advanced syntax highlighting
- Integrate with Git to show file modifications
- Be a drop-in replacement for (POSIX) cat
- Offer a user-friendly command-line interface
It is, needless to say, much faster than pygmentize and does not choke when confronted with large files.
Source code and binary releases + installation instructions can be found in the Github repository, as well as a comparison to alternative programs.