Bat – Advanced Cat for Linux

0
498

If you’re using Linux, you already used the “cat” command, right? It’s a command that opens a file in the terminal window. Bat is a cat command clone. It offers all the same features as the cat. However, it comes up with a number of additional features like syntax highlighting, Git integration, automatic paging, file concatenation etc.

If you need, you can also add other language definitions and new syntaxes, themes and custom pager etc.

Let’s enjoy Bat!

Installing Bat

Bat is available on all the major Linux platforms. Run the following command(s) according to your own Linux distro.

  • Ubuntu/Debian

Download the latest DEB package of Bat.

Now, run the following command(s) –

  • OpenSUSE

  • Arch Linux

  • Generic Linux instruction

You have to build Bat from source. Follow the instructions on Bat official page on GitHub.

Using Bat

Check out all the file extensions and languages Bat support –

Let’s check out an HTML file.

Why not check out a bash file?

Script – https://github.com/paxtonhare/demo-magic 

Script – https://github.com/paxtonhare/demo-magic

Need to check out multiple files? Use the following command –

 

Script – https://github.com/paxtonhare/demo-magic
Script – https://github.com/paxtonhare/demo-magic

You can also tell Bat to show a range of line from a certain file –

List all the available themes for Bat –

Enable a specific theme right away!

You can find out more about Bat on GitHub.

Enjoy!

Spread the love
  • 14
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here