bat

github.com/sharkdp/bat File Utilities Open-source projectOpen source

Browse and print file contents with bat, a command-line cat alternative documented in this repository.

github.com/sharkdp/bat
bat homepage screenshot

About bat

bat is a command-line tool for displaying file contents, described as a cat(1) clone with syntax highlighting and Git integration. It highlights syntax for programming and markup languages, shows Git modifications relative to the index, can display line numbers, and can show non-printable characters with -A/--show-all. By default it sends long output to a pager such as less, but prints plain file contents when piped to another process or file. Highlighting from stdin depends on detection from the first line or an explicit language flag, and line numbers and Git markers can interfere with copying unless plain mode or piping is used.

Key features

  • Syntax highlighting for programming and markup languages
  • Shows Git modifications relative to index in sidebar
  • Displays non-printable characters with -A/--show-all
  • Automatic paging of long output via pager like less
  • Concatenates files and acts as cat when piped
  • Reads from stdin with automatic or explicit language selection
Best for: People who use the terminal and want to view files with syntax highlighting and Git context.
Good for
  • Functions as cat replacement when output is piped or redirected
  • Paging is configurable, including --paging=never to match cat
  • Combines with tools such as fzf, find, fd, ripgrep, tail and git
Watch out for
  • Stdin highlighting requires detectable syntax or explicit -l flag
  • Line numbers and Git markers can interfere with copying without plain mode
  • Paging must be disabled for use with tail -f

bat at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

bat alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in File Utilities

Well-known listings from the same topic.

All 184

bat FAQ

How can I make bat behave like cat without paging?
Use --paging=never on the command line or in the configuration file, for example alias cat='bat --paging=never'.
How do I show non-printable characters?
Use the -A/--show-all option, for example bat -A /etc/hosts.
How do I copy file contents without line numbers and markers?
Use -p/--plain or pipe the output, for example bat main.cpp | xclip; bat prints plain contents when redirected.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing