A cat clone with syntax highlighting, line numbers, and Git integration.
bat
bat Cheatsheet
| Command | Description |
|---|---|
bat <file> |
View file with syntax highlighting |
bat -n <file> |
Show line numbers only (no decorations) |
bat -p <file> |
Plain output (no line numbers or header) |
bat -l json <file> |
Force a specific language for highlighting |
bat --list-languages |
List all supported languages |
bat --list-themes |
List all available color themes |
bat -r 10:20 <file> |
Show only lines 10-20 |
bat -A <file> |
Show non-printable characters |
bat --diff <file> |
Show Git diff markers |
bat f1.txt f2.txt |
View multiple files |