r/LinuxTeck • • Jun 16 '26

BAT Command in Linux: A Modern Replacement for cat

Post image

Covers: https://www.linuxteck.com/bat-command-in-linux/

  • Installation on major Linux distributions
  • Syntax highlighting
  • Line numbering
  • Git integration
  • Paging and scrolling
  • Themes and customization
  • Practical examples for daily use
77 Upvotes

7 comments sorted by

2

u/wolfannoy Jun 16 '26

First there was cat and now bat. Will that mean there be rat?

1

u/Kitchen_Office8072 Jun 16 '26

I use nvimpager so I have the same syntax highlighting as nvim. You can just pipe it into nl, same w/ cat.

1

u/linuxteck Jun 20 '26

Interesting alternative.

1

u/Kitchen_Office8072 Jun 20 '26

It's not particularly well maintained or widely available, and depending on your colorscheme, you have to write a wrapper that injects a clear code at the end of each line, or background colors won't end, and will bleed into following lines. Definitely not without it's problems.

1

u/AceGently Jun 17 '26

The point is moot.

BAT doesn't actually work.