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
- tmuxtmux is a free, open-source terminal multiplexer. It lets you run several programs in one terminal, split into windows and side-by-side panes, and switch between them with the keyboard. Its most useful trick is sessions: detach from a session and everything in it keeps running, even after you close the terminal or lose an SSH connection, and reattach later exactly where you left off. tmux is developed by Nicholas Marriott and contributors and released under the ISC license.Developer Tools
VigilVigil is a free, open-source native Mac terminal for running coding agents as a team. Instead of copying messages between several agent windows yourself, you give a task to a root manager agent, which can start worker agents and sub-managers of its own. Detail flows down the tree and results roll back up to the manager as summaries, which keeps the manager's context lean. A live node tree shows the whole team at once, and every node keeps the agent's own terminal interface, so you can open any of them and take over directly.Developer Tools
SwitchShuttleSwitchShuttle is a menu bar app for Mac that keeps your most-used terminal commands one click or one keyboard shortcut away. You organize commands into nested submenus, give each one a global hotkey and an emoji icon, and run it from anywhere without first opening a terminal and typing it. It works with iTerm, Terminal, Warp, Alacritty, Hyper and other terminals, and each command can run in the current window, a new tab or a new window.Developer Tools
tty7tty7 is a GPU-rendered terminal written in Rust, built on Zed's gpui and Alacritty's terminal core. A background server owns your shells and panes rather than the window, so you can quit the app and your shells keep running without tmux. After a reboot, the layout, the screen and supported agent conversations come back.Developer Tools
TabbyTabby, formerly called Terminus, is a highly configurable terminal emulator that also works as an SSH, Telnet and serial client. It replaces several tools at once: a local terminal with tabs and split panes, a connection manager for your servers, and a serial terminal for devices such as routers and microcontrollers. Your SSH passwords and keys can be kept in an encrypted vault, files can be transferred over SSH, and the look and features can be changed with themes and plugins. Tabby is developed by Eugene Pankov and runs on Mac, Windows and Linux.Developer Tools
kittykitty is a fast, feature-rich terminal emulator that uses your GPU to draw text, so scrolling and large outputs stay smooth. It has tabs and split windows with several layouts built in, support for true colour, ligatures and emoji, and its own graphics protocol for showing images right inside the terminal. kitty can be controlled from scripts and the command line, and extended with small programs called kittens, for tasks such as SSH with your settings, side-by-side file diffs and Unicode input. kitty is made by Kovid Goyal, the developer of calibre.Developer Tools
More from David Peter
FULLMAC.app does not host this app. Download buttons lead to the developer’s own pages.