6 nonobvious tools that should be in your command-line toolbox
[linux
programming
learning
command-line
efficiency
]
Introduction
In this short post, I would like to present some tools that can be useful when working with command line terminals.
I am using zsh
shell (a shell is the name of the program that runs in the terminal) on MacOS, but most of the following suggestions should work on Linux and other shells.
asciinema - recording your terminal
The first tool asciinema is a kind of meta-tool that can record our terminal session. It is extremely helpful for presentations and blog posts to make interactive examples by using gif
files.
Installation
$ brew install pipx
$ pipx ensurepath
$ pipx install asciinema
Usage
To start a session we have to execute the following instruction.
$ asciinema record <filename>
asciinema: recording asciicast to <filename>
asciinema: press <ctrl-d> or type "exit" when you're done
Now, our terminal actions are recorded until we stop the program by hitting exit
or ctrl+d
. We can run the recording using asciinema play <filename>
or convert our file into a gif
format (e.g. using online program).
z plugin - move between folders quickly
z plugin is a tool that enables us to move between our directories (that were visited frequently in the past) quickly without typing full absolute or relative paths.
Installation
I recommend installing this plugin using a manager like oh-my-zsh. However, you can choose other options suggested in the docs.
Usage
bat - inline syntax highlighter
bat is a program that supports inline syntax highlighting for many programming and markup languages.
Installation
$ brew install bat
Usage
ctr+r - history search
ctr+r
is the keyboard shortcut that is built-in functionality in a terminal. It enables recursive search through your command usage history.
Usage
ultimate plumber - explore textual data
Ultimate plumber is a tool that can interactively show us the results of text processing using Linux pipes. It gives us a playground with immediate feedback on our operations.
Installation
$ brew install up
Usage
navi - cheatsheets
navi is a popular tool that provides interactive cheatsheets for many programs like git
, docker
, kubectl
, etc.
Installation
$ brew install navi
Usage
To start using navi, we should first import some cheatsheets (using navi repo browse
) that would be interesting and helpful for us.
Conclusion
I have shown some useful features of zsh
shell for your terminal. I hope it would be helpful. If you seek more, I recommend you to visit:
-
https://github.com/dpokusa/linux-terminal-efficiency
-
https://github.com/agarrharr/awesome-cli-apps