Skip to content
← Tools / Skills
ToolDavid Peter (sharkdp)/10 trustMetrics-checked

bat

A cat clone with wings: syntax highlighting, Git gutters, and automatic paging.

Visit official site →

About

bat is a cat(1) clone with syntax highlighting and Git integration, created by David Peter (sharkdp) and written in Rust. It is a drop-in replacement for cat that makes reading files pleasant: syntax highlighting for over 200 programming and markup languages using Sublime Text grammars, line numbers, a Git gutter showing added, modified, and removed lines relative to the index, and automatic paging through less when output is too long for one screen.

When its output is piped or redirected, bat quietly degrades to plain cat behavior, so aliasing cat to bat is safe. Extras include --show-all for non-printable characters, --line-range for printing slices of files, and --diff for showing only modified lines with highlighting. It pairs naturally with fzf as a preview command and lends its syntax themes to delta. Free, dual-licensed MIT/Apache-2.0, and packaged for every major platform.

What it can do

  • Syntax highlighting for 200+ languages
  • Git gutter showing modifications relative to the index
  • Automatic paging through less for long output
  • Plain cat fallback when piped or redirected
  • --show-all rendering of non-printable characters
  • --line-range for printing file slices
  • --diff mode showing only modified lines
  • Customizable themes and Sublime-style grammars
  • Popular pairing with fzf --preview
  • Linux, macOS, Windows, and cargo builds

Setup

Install via Homebrew (brew install bat), apt, pacman, Scoop, cargo, or GitHub releases. Many users alias it: alias cat='bat'. Configure the default theme and style in ~/.config/bat/config (e.g. --theme="Dracula"), and add custom grammars as .sublime-syntax files if you need a language it does not cover.

Prerequisites

A terminal with color support; optional: fzf for preview integration.

Use cases

file-viewingcode-readinggit-diff-reviewfzf-previewsconfig-inspection

Works with

developersdevopsstudentspower-users

Trust score — 9/10

/10 trustMetrics-checked

Scored 9/10 (metrics tier, metrics-v1). Evidence: ~60.8k GitHub stars with commits pushed October 14, 2026; independent writeups confirm the 200+ language grammars, Git gutter, automatic paging, plain-cat pipe fallback, and fzf/delta integrations. Strengths: ubiquitous and battle-tested, safe as a cat alias, generous dual license, thorough docs. Docked for: (1) highlighting quality depends on third-party Sublime grammars and varies by language; (2) startup cost is slightly higher than cat for huge piped streams; (3) no official square logo exists. License: MIT/Apache-2.0 (dual).

★ 60,803 GitHub stars

How the trust score is built

Full methodology →
Adoption · stars/downloads, log-scaled vs peers
10.0/10
Maintenance · recency, releases, issue load
9.0/10
Openness · license + docs
10.0/10
Manual review · sanity read + red-flag check
9.0/10
  • · ~60.8k GitHub stars (Oct 16, 2026 snapshot), commits pushed Oct 14, 2026; by David Peter (sharkdp); Rust
  • · 200+ language grammars; Git gutter; auto paging; plain-cat fallback when piped; --show-all; --line-range
  • · Grammar quality varies by language; themes shared with delta; no official square logo

Sources

Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.