wolfgang ziegler


„make stuff and blog about it“

bat your files!

November 17, 2022

TIL about bat, which is basically an improved version of the well-known Unix tool cat.

bat is an open-source tool, written in Rust that provides the same syntax and options as cat but with nice features like syntax-highlighting, line numbering, and automatic paging on top.

Usage

Let's have a look at a boiler-plate ASP.NET MVC Program.cs file.

Using cat:

A C# file printed with cat

... hmmm, ok.

Now, the same file using bat:

A C# file printed with bat

Wow 🤩, quite the difference, right?

Installation

So, if want to give bat a spin yourself. Here's how to get it.

Linux:

sudo apt install bat

Mac OS:

brew install bat

Then ...

BAT ALL THE FILES! meme