Following the post about colorizing the CLI, this time you will discover some interesting CLI application to enhance your workflow. For each app you will see its usage in real world examples and a comparison with the other applications. This showcase will be split over different posts with 4 applications each.
Ready? Let’s begin the journey!
Prerequisites: Basic knowledge about Unix command line and its applications.
Notes: For each software listed here, a link to its repology page will be attached; this way you can check if it has been packaged for your distribution of choice and use the system package manager to install it.
ls is the most used application while interacting with the CLI. For this
reason the first application is its modern alternative:
The invocation is the same as
Yay, exa printed out some colors. However, ls can do the same when using
--colors=auto. Let’s try some advanced option.
The options used above are self-documenting, but if you want to know more about
them, just call the help page of exa (
exa --help ).
You can personalize further how exa looks by adding more arguments. For example this is my personal preference:
Wrapping up all the features highlighted above, here it is a function to use
ls alternative (here it is mapped to
l but feel free to map it
according to your preference):
$ alias l='exa --icons --all --git --git-ignore --group-directories-first'
You can notice that
--long have been removed, so that it can be added when you need call
$ l --long
You can also use its abbreviated form
-l or add another alias
$ alias ll='l --long'
The next application is a git diff viewer:
Delta takes git output, formats it in a stylish way and add syntax highlighting. It supports many git commands like the following (and more):
git log -p
git stash show -p
git reflog -p
git add -p
git, add the following to your
[core] pager = delta [interactive] diffFilter = delta --color-only
delta supports many themes; you can see the complete list by running:
$ git --list-syntax-themes
After you have found one that you like or that pairs well with your terminal
theme, add it to the config (
[delta] syntax-theme = Monokai Extended
Plus and minus color have to be chosen manually. Here I use the ones for
the Monokai theme (in
delta section as used above):
plus-color = "#ff6188" minus-color = "#a9dc76"
Side by side
To enable side by side comparison, add the following to
[delta] side-by-side = true
Recent versions of git (>= v2.17, April 2018) supports new
argument that will highlight lines that have been moved with a different
style than the one used with added/removed lines.
delta will automatically
decect when this feature has been enabled, and modify its output accordingly.
All you have to do is enable
--color-moved in git by default, by adding the
following to your
[diff] colorMoved = default
You can also customize the colors by adding:
[color "diff"] oldMoved = "#ab9df2" newMoved = "#ffd866"
color-moved usage by reading raw colors from
git output. If it causes problem, disable this feauture in
[delta] inspect-raw-lines = false
How many of you use
dig to perform a DNS query from the terminal? And how
many of you use the newer
drill to do the same? This application is aimed
for you both!
dog is a modern DNS client for the CLI, written by the developer of
It includes some cool features like emitting the output as JSON or printing the time spent for the request.
It also let you choose which protocol to use between the following:
- DNS over UDP (default)
- DNS over TCP
How many times have you came across a Markdown and had to read it as plain text? The syntax is easy and looks good when rendered. However, using projects like livedown just to read a 100 line Markdown file is overkill.
Mandown is a Markdown pager for the command line.
Let’s create a simple Markdown file to test mandown with. It will be called
## Hello world! I am _fairly_ simple **Markdown** file. - [ ] todo1 - [x] todo2 ### Credits Thanks to everyone reading this post :). ]
Now we can use mandown to render it:
$ mdn HelloWorld.md
As of version 1.0.1 (16 July 2020), mandown support for the majority of HTML tags is in development. It will work best on Markdown only files, for now.
That’s all for this post. Did you already know any of the application highlighted above? Do you know another alternative or application you want to see in the next posts? Comment below!