A cat clone with syntax highlighting and Git integration. Supports a wide range of programming languages.
bat is a modern replacement for the classic cat command, enhanced with syntax highlighting and Git integration. It supports syntax highlighting for a large number of programming and markup languages, making code files much more readable when viewing them in the terminal. The tool also integrates with Git to show file modifications in the left sidebar, helping developers quickly identify changes.
Beyond basic file viewing, bat includes automatic paging for large files, the ability to show non-printable characters, and seamless integration with popular tools like fzf, ripgrep, and git. It can be used as a drop-in replacement for cat while providing additional functionality, or configured to work exactly like cat when piping output. The tool is designed for developers, system administrators, and anyone who frequently works with text files in the terminal and wants a more feature-rich viewing experience.
bat excels in development workflows where you need to quickly examine code files, view logs with syntax highlighting, or integrate file viewing into shell scripts and command pipelines. It automatically detects when output is being redirected and falls back to plain text mode, ensuring compatibility with existing workflows while enhancing interactive use.
# via Homebrew
brew install bat
# via apt (Ubuntu/Debian)
sudo apt install bat
# via Cargo
cargo install bat


