bat (sharkdp/bat)

Searching Database…

61.6K ·GitHub
What is this?bat is a cat(1) clone that prints files in the terminal with syntax highlighting for a large number of programming and markup languages, plus Git modification markers in the sidebar.
Is it a GUI app or a plain terminal command?A command-line tool. When it detects a non-interactive terminal (piping into another process or a file), it acts as a drop-in replacement for cat and prints plain contents.
What's the quickest way to get bat on my machine?Your package manager: apt on Ubuntu 20.04+/Debian 11+, brew on macOS and Linux, winget/Chocolatey/Scoop on Windows, or a prebuilt binary from the release page.
Is there anything I need to install alongside it?It is a single static binary, but on Windows you need the Visual C++ Redistributable; building from source requires Rust 1.79.0 or higher.
Any gotchas right after installing?On some older Ubuntu/Debian releases the executable is installed as batcat instead of bat due to a name clash; try batcat --version and set up a bat -> batcat symlink or alias.
Does it work on macOS, Windows, and the various Linux distros?Yes: packages for Ubuntu/Debian, Alpine, Arch, Fedora, Gentoo, openSUSE and Nix, macOS via Homebrew or MacPorts, Windows via WinGet, Chocolatey or Scoop, plus FreeBSD and OpenBSD.
Why does long output sometimes open in a pager?By default bat pipes its own output to a pager such as less when the file is bigger than one screen; use --paging=never, or alias cat='bat --paging=never', to always print directly.
Does highlighting still work when reading from stdin?Only if the syntax can be determined from the first line, usually via a shebang such as #!/bin/sh; otherwise specify it explicitly, e.g. bat -l log.
Can I pick a different color theme?Yes: run bat --list-themes to preview, then set it with --theme or the BAT_THEME variable; bat also picks a fitting theme automatically based on your terminal's background.
Does it play well with other terminal tools?The README documents bat as an fzf previewer, as the printer for ripgrep results via batgrep, as a colorizing MANPAGER for man pages, for find/fd previews, and with git show and git diff.
What are similar projects?vis, delta, diff-so-fancy, fish-shell, linguist, redox, gitlogue, git
Creator
sharkdp
Size
34.5 MB
Stars
61.6K
Age
8y
Commits · 90 Days