The cat utility predates Linux, but you might wonder if there’s something better than this standard utility.

What Is bat?

bat is a clone of cat with some modern features.

Paper bats against orange background

The tagline on itsGitHub pageis “a cat clone with wings.”

One major feature is the addition of line numbers to any output.

It also automatically recognizes several programming languages and highlights syntax.

bat homepage

It also integrates seamlessly with Git.

Installing bat on Linux

Installing bat on a Linux desktop is easy enough.

It’s available in many Linux distribution’s official repositories.

Linux bat utility showing syntax highlighting for a C “Hello, world!” program

you’re free to use it with files or with standard input.

you could call it at the command line with “bat.”

If you’re on Ubuntu or Debian, call it by typing “batcat” instead.

bat -n option showing line numbers

The first thing you’ll notice is that bat draws a border around the output with line numbers.

This seems to just make it prettier.The standard cat programdoes have the-noption to display line numbers.

If you don’t like the decorations, you could use the-nto only display line numbers.

bat will detect many popular programming languages and highlight the syntax.

It offers some unique features, such as pretty-printing line numbers, paging, and syntax highlighting.

bat is not the only modern take on classic Unix utilities out there.

There are many replacements for time-tested utilities like grep or man that you might want to check out.