Bat – Advanced Cat for Linux

Windows Articles

Is ReactOS a real alternative to Windows?

Oh! The eternal struggle of computer operating systems. Windows vs. GNU/Linux and Mac as a distant spectator However, there are also interesting...

How to install Firebird on Ubuntu 20.04/ 18.04?

Database management systems are sufficient for many kinds of projects. Of course, they abound with MySQL / MariaDB or PostgreSQL popular but...

How to disable Firewall in Windows Server 2019/2016

Hello! The Firewall performs an essential security task on any version of Windows Server. In fact, it has the mission of preventing...

How to install ArangoDB on Ubuntu 20.04?

In this post, you will learn how to install ArangoDB on Ubuntu 20.04 So let's go for it What...

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...

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) –

sudo dpkg -i bat_0.9.0_amd64.deb

  • OpenSUSE
sudo zypper install bat
  • Arch Linux
sudo pacman -S bat
  • 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 –

bat --list-languages

Let’s check out an HTML file.

bat ~/Desktop/demo.html

Why not check out a bash file?

bat demo-magic.sh

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

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

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

bat demo-magic.sh README.md

 

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 –

bat --line-range 10:20 license.txt

List all the available themes for Bat –

bat --list-themes

Enable a specific theme right away!

bat --theme=Github

You can find out more about Bat on GitHub.

Enjoy!

More articles

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Is ReactOS a real alternative to Windows?

Oh! The eternal struggle of computer operating systems. Windows vs. GNU/Linux and Mac as a distant spectator However, there are also interesting...

How to install Firebird on Ubuntu 20.04/ 18.04?

Database management systems are sufficient for many kinds of projects. Of course, they abound with MySQL / MariaDB or PostgreSQL popular but...

How to disable Firewall in Windows Server 2019/2016

Hello! The Firewall performs an essential security task on any version of Windows Server. In fact, it has the mission of preventing...

How to install ArangoDB on Ubuntu 20.04?

In this post, you will learn how to install ArangoDB on Ubuntu 20.04 So let's go for it What...

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...