- Tue 16 June 2020
- Misc
- Marius Mather
- #shell, #terminal, #zsh
While I'm pretty comfortable with basic shell commands, I like the convenience of features like syntax highlighting. Lately I've discovered a few replacements for common shell commands that add an extra bit of colour:
bat: cat with syntax highlighting
bat
is a drop-in replacement for cat
that adds syntax highlighting
and line numbers by default - great for when you want to check
the contents of a script:
On Mac you can install it via Homebrew:
brew install bat
exa: ls with syntax highlighting
On a (very) similar note, exa
is a drop-in replacement for ls
that adds
a bit more colour. By default, it just adds some colouring for different
file types:
When used with options like -l
it adds some colour to the structured
information, e.g. the permissions:
Again, install with Homebrew:
brew install exa
ripgrep: an easier grep
I'm very bad at using grep
- I can never remember whether the
file or the pattern goes first. ripgrep
makes grep
more convenient:
by default you can just give it a pattern and it will search the
current folder recursively (automatically skipping hidden files and files
in your .gitignore
).
You get nice colourful output with the matches highlighted:
brew install ripgrep
Lots more
I've only covered tools that I've been using regularly - there are plenty more out there if you want to improve your shell. There's a long list here, and other fun tools like asciinema which lets you record gifs/videos of your shell sessions.