bat for MAC

Free, open-source cat clone for the terminal with syntax highlighting, Git integration and automatic paging.

bat Overview

bat is a free, open-source replacement for the cat command that shows files in Terminal with syntax highlighting. It colors code in a large number of programming and markup languages, shows which lines you changed in Git, numbers the lines and sends long files to a pager automatically, while still working like cat when you pipe its output to other commands. bat is made by David Peter and the bat developers and is dual-licensed under the MIT license and the Apache License 2.0.

bat runs in Terminal on Apple Silicon and Intel Macs and installs with Homebrew (brew install bat) or MacPorts. It works well with other tools: you can use it for previews in fzf, to color man pages, or to show ripgrep results.

Key Features

bat makes reading files in Terminal much easier.

  • Syntax highlighting: colors code in a large number of programming and markup languages.
  • Git integration: shows added and changed lines in the side bar.
  • Non-printable characters: bat -A shows tabs, spaces and line endings.
  • Automatic paging: long output goes to a pager such as less.
  • cat-compatible: when piped, bat behaves like cat and outputs plain text.
  • Themes: pick a color theme; bat --list-themes shows them all.
  • Line ranges: show only part of a file with --line-range.
  • Works with other tools: previews in fzf, colored man pages and more.

What’s New in Version 0.26.1

bat 0.26.1 adds a small feature and fixes several bugs.

  • Paging for -h and --help
  • Fixed a hang when using --list-themes with a pager
  • Fixed negative values in line ranges not being read correctly
  • Fixed broken Docker syntax that prevented custom assets
  • Decorations are no longer added unexpectedly when piping

bat FAQ

Is bat free?

Yes. bat is free and open source, dual-licensed under the MIT license and the Apache License 2.0.

How do I install bat on a Mac?

Run brew install bat in Terminal if you use Homebrew, or install it with MacPorts. Ready-made programs for Apple Silicon and Intel Macs are on its GitHub releases page.

How is bat different from cat?

bat adds syntax highlighting, line numbers, Git change markers and automatic paging. When you pipe its output to another command, it behaves like cat and prints plain text.

Which languages can bat highlight?

bat highlights a large number of programming and markup languages, and you can add new syntax definitions yourself.

How do I change bat's color theme?

Run bat --list-themes to see the themes, then use --theme, or set the BAT_THEME environment variable to keep your choice.

How do I turn off the pager in bat?

Use --paging=never, or set it in bat's configuration file. bat only pages output that does not fit on the screen.

Can bat show hidden characters?

Yes. bat -A shows non-printable characters such as tabs, spaces and line endings.

Can I use bat with fzf?

Yes. bat is often used as the preview command in fzf, for example fzf --preview "bat --color=always {}".

Can bat color man pages?

Yes. bat's documentation shows how to set it as the MANPAGER so man pages appear with syntax highlighting.

Where does the bat download on bat.FULLMAC.app come from?

The download button leads to bat's official GitHub page at https://github.com/sharkdp/bat, with the install instructions and releases. bat.FULLMAC.app does not change or repackage the tool.

Similar Apps

More from David Peter

FULLMAC.app does not host this app. Download buttons lead to the developer’s own pages.