Gem

bat

cat with syntax highlighting, line numbers and git change markers.

Would you recommend bat?

No votes yet. Tried it? Be the first to say.

One vote per person. No account needed.

Overview

bat prints files the way cat does, but with syntax highlighting for hundreds of languages, line numbers, and markers in the margin for lines changed since the last commit. Long files open in a pager. When its output goes to a pipe it behaves exactly like plain cat, so it's safe to alias.

Instead of
cat and less for reading code in the terminal
Reach for it when
You read source or config files in the terminal often, or want highlighted previews inside fzf.

Try it in a few minutes

Terminal
brew install bat   # or: winget install sharkdp.bat / apt install bat (binary is 'batcat' on Debian/Ubuntu)
bat README.md
bat --list-themes

Related tools

Other tools that share topics with bat.

Starship

starship.rs
Gem

A fast, cross-shell prompt that shows your git status, language versions and more.

Instead of Oh My Zsh themes, Powerlevel10k, and hand-written PS1 strings

Zellij

zellij.dev
Gem

A terminal workspace with panes, tabs and sessions, and on-screen hints so you don't need to memorise keys.

Instead of tmux and GNU screen

Worktrunk

worktrunk.dev
New

Git worktrees made as easy as branches, so you can run several coding agents in parallel.

Instead of Typing git worktree add / cd / remove by hand, or running one agent at a time in one checkout

1 recommend