illustration: linux-bat-installation-on-debian-10.en

bat is a command-line tool to display text files. It provides syntax highlighting, git integration and many other features. If you plan to spend some time in the Terminal, you should definitively install it to replace cat.

According to the documentation, bat should be only available for Debian sid.

Here is how to install it on Debian 10:

  • download the last .deb file from the Release page
  • run sudo apt install ./bat-musl_*_amd64.deb in a Terminal
  • Done, there is no step 3!

The result in video:

A report was submitted to suggest an update of the documentation.

Advanced usage

List available themes

bat --list-themes | fzf --preview="bat --theme={} --color=always"

Preview files with fzf

fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'
  • ccat: show ‘cat’ command output with syntax highlighting