Bat is a modern replacement for the Unix cat command that adds syntax highlighting, Git integration, and automatic paging to file viewing in the terminal. Written in Rust and using the same syntax highlighting engine as Sublime Text, bat supports over 170 programming and markup languages out of the box. It solves the problem of reading code files in the terminal being a poor experience compared to viewing them in an editor, bringing rich visual formatting to command-line file inspection.
Bat automatically detects the file type and applies appropriate syntax highlighting with customizable color themes, displays line numbers by default, shows Git modifications in the left margin, and pipes output to a pager like less when the content exceeds the terminal height. It also supports displaying non-printable characters, can concatenate multiple files, and integrates with other command-line tools as a drop-in replacement for cat. Bat's themes are compatible with Sublime Text and TextMate theme formats, offering extensive visual customization.
Bat is essential for developers who spend significant time reading code and configuration files in the terminal. It pairs exceptionally well with other modern CLI tools like ripgrep, fzf, and fd, and can be aliased to replace cat for everyday use. Available on macOS, Linux, and Windows, bat has become a standard part of the modern terminal toolkit, frequently recommended alongside other Rust-based CLI utilities for upgrading the default Unix command-line experience.