bat
TLDR
View file with syntax highlighting
SYNOPSIS
bat [options] [file...]
DESCRIPTION
bat is a cat clone with syntax highlighting and Git integration. It displays file contents with automatic language detection, line numbers, and Git diff indicators in the margin.
The tool provides a more user-friendly file viewing experience for developers and system administrators.
PARAMETERS
-n, --number
Show line numbers-A, --show-all
Show non-printable characters-p, --plain
Plain mode (no decorations)-l, --language lang
Specify language for syntax highlighting-H, --highlight-line n
Highlight specific lines--paging when
When to use pager (auto, always, never)--style components
Configure output style--theme name
Color theme--list-languages
List supported languages--list-themes
List available themes
FEATURES
- Syntax highlighting for 200+ languages
- Git integration (shows modifications)
- Line numbers
- Non-printable character display
- Automatic paging
- File concatenation
- Themes support
- Integrates with less pager
CONFIGURATION
Config file: `~/.config/bat/config`
--style="numbers,changes,grid"
CAVEATS
Not a drop-in cat replacement for scripts (use cat for pipelines). Slower than cat on large files. Themes require true color terminal. Some syntax highlighting requires additional setup.
HISTORY
bat was created by David Peter (sharkdp) in 2018 as a modern replacement for cat with syntax highlighting and Git awareness.


