The letter A styled as Alchemists logo. lchemists Syndication Icon

Putin's War on Ukraine - Watch President Zelenskyy's speech and help Ukraine fight against the senseless cruelty of a dictator!

Published October 29, 2019 Updated May 11, 2020

Shell Bat

Demonstrates using the Bat program for inspect files with syntax highlighting and line numbers.

Transcript

# Hello and welcome to the Alchemists Screencasts!
# Today, we'll look at using Bat (https://github.com/sharkdp/bat).

# Bat is a great enhancement to native `cat` shell behavior:

\cat Rakefile

# 💡 I have `cat` aliased to `bat` which is why the backslash is being used:

cype cat

# While the above output is useful, support for the following would be better:
#  - Line numbers.
#  - Syntax highlighting.

# Let's see what the output looks like when using Bat (again, aliased as `cat`):

cat Rakefile

# I don't know about you, but I find that much easier to read. 🎉
# It's also easy to copy and paste without the special formatting:

cat Rakefile | pbcopy

vi example.txt

# Be sure to read up on the Bat documentation for further examples and usage.

# Enjoy!
# https://www.alchemists.io
# ☿ 🜔 🜍 🜂 🜃 🜁 🜄