OSS TanbouSign in with GitHub

Read files in the terminal with syntax highlighting and Git-aware changes

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
60,668
Primary language
Rust
License
Apache-2.0
Repository last updated
Oct 1, 2026
On this page

Overview

bat is a CLI that displays file contents like cat(1) while adding syntax highlighting for source code and configuration files. It can show changes relative to the Git index, line numbers, and non-printable characters, and sends long output through a pager. When output is piped or redirected, it automatically falls back to plain cat-like content.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Inspect syntax and Git changes in one terminal view

bat detects many programming and markup languages for syntax highlighting and marks lines changed from the Git index in the margin. The -A option reveals non-printable characters such as tabs and line endings, which helps when reviewing code or diagnosing configuration files.

Sources: [1]

Adapt long output and compose with other command-line tools

Output longer than one screen goes through a pager by default. When redirected to another process or file, decorations are removed so the content can continue through a pipeline. The README also documents use with fzf, fd, git show, and continuously updated logs.

Sources: [1]

Best fit

Fits workflows that inspect source and configuration files from the shell

bat is useful when a file needs a quick readable view without opening an editor, or when search results need to be previewed one at a time. It also suits developers and operators who want line numbers, diffs, and highlighting through one command.

Sources: [1]

Before adoption

Check pager behavior, executable naming, and license terms

Interactive terminals enable automatic paging, so use --paging=never when cat-compatible behavior is required consistently. Ubuntu and Debian packages may install the executable as batcat because of a naming conflict. Version 0.26.1 is offered under either the MIT License or Apache License 2.0; review both license files for your distribution choice.

Sources: [1][2][3][4]

Official sources

  1. [1]bat README at v0.26.1(2026-10-04)
  2. [2]bat v0.26.1 release(2026-10-04)
  3. [3]bat Apache License 2.0 text at v0.26.1(2026-10-04)
  4. [4]bat MIT License text at v0.26.1(2026-10-04)
Supplemental curator note

If you plan to replace cat, test both interactive viewing and redirected or piped output. Checking existing aliases and pager settings first makes bat easier to adopt without surprising shell behavior.

Try it in 3 steps

  1. 1

    Install bat with Homebrew

    This is the official README path for macOS or Linux.

    brew install bat
  2. 2

    Create a Rust file to display

    Create a small file with an LF-terminated final line in the current directory.

    printf '%s\n' 'fn main() {' ' println!("hello");' '}' > bat-demo.rs
  3. 3

    Inspect line numbers and highlighting

    Use documented display options to check Rust highlighting and line numbers.

    bat --style=numbers --color=always bat-demo.rs
Check the official README

Growth

Growth trends · Last 30 days

60,668 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
5
Open PRs
206

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • command-line
  • tool
  • syntax-highlighting
  • git
  • terminal
  • cli
  • rust
  • hacktoberfest
Stars
60,668
Forks
3,349
Watchers
250
Open issues
333
Contributors
491
Owner type
User
Primary language
Rust
License
Apache-2.0
Repository last updated
Oct 1, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?