Follow

This week's —which we're getting in *just* under the wire for the week—is , the `cat` replacement with syntax highlighting, git integration, (optional) line numbers, and more.

github.com/sharkdp/bat

See below for a cat/bat comparison (showing a bit of the 's code). And if you don't like those colors, don't worry—bat lets you select a different color scheme or customize your own (along with pretty much any other config option you might want).

@clirust does it also do what cat is designed for (con**cat**enating files)?

@Matter
It's a pretty cool tool if spend a lot of time in the CLI. I've been using it for a while. I've literally just aliased bat to cat so I don't have to remember it's even there. Works like a charm no matter what context I'm using it in.
@clirust

@Matter

> does [bat] also do what cat is designed for (con**cat**enating files)?

It does! It will automatically detect when it's being used non-interactively such as in a pipe and output plain text (that is, without syntax highlighting and all that)—perfect for concatenating files.

In fact, you can force that behavior with `bat --plain` (or `bat -p`), which turns `bat` into a drop-in replacement for `cat`

@clirust Been using it for quite some time, super recommended!

Sign in to participate in the conversation
Fosstodon

Fosstodon is a Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.