github twitter linkedin
CLI on steroids: Productivity boost on the linux command-line
Apr 2, 2019
4 minutes read

This post is inspired by a post by Remy Sharp at https://remysharp.com/2018/08/23/cli-improved

Please read that blog post as I won’t repeat some tools mentioned in that blog

If you use *nix OS then you’ll find yourself using command-line more often than not. I find myself using the command-line majority of the time and I prefer using CLI over GUI. Linux command-line by default has tools that are mature and powerful to get most tasks done.

Over the years, I have picked up various tools that are not available by default in Linux command-line. I use these tools extensively to improve my CLI experience and stay productivity.

In this blog post, I’ll list various tools that I use to improve my CLI experience. I’ll try not to repeat the tools mentioned in Remy blog post unless necessary.

fzf > ctrl+r

In terminal, ctrl+r is used to search through history but I found ctrl+r to be not intutive. fzf is a great alternative to ctrl+r.

Project page: https://github.com/junegunn/fzf

Remy blog covers this tool: https://remysharp.com/2018/08/23/cli-improved#fzf--ctrlr

zoxide > fasd > cd

This section recommended fasd in the past but the project is deprecated. Use zoxide instead.

Project page: https://github.com/ajeetdsouza/zoxide

Traversing directories is one of the most tedious things to do on the command-line. zoxide boosts your productivity by offering ways to quickly access to files and directories.

Zoxide ranks files and directories by “frecency,” that is, by both “frequency” and “recency”

Zoxide defines various powerful commands but I tend to use the following commands frequently

  • z <keyword>: To quickly switch to the highest weightage directory with the keyword
  • zi <keyword>: List of all directories with the keyword and their corresponding weightage
  • zoxide add <dir>: Add a specific directory to zoxide

zoxide required fzf as a prerequisite.

fd > find

find is a command to find files. Although powerful, it is a struggle to remember the syntax for the find command.

fd is a great replacement for find. The command suntax is straight forward and covers all the common use cases.

Remy blog covers this tool - https://remysharp.com/2018/08/23/cli-improved#fd--find

trippy > mtr > traceroute

This section recommended mtr in the past but I have started to use trippy often. mtr and trippy are great tools solving the same problem.

Project page: https://github.com/fujiapple852/trippy

trippy is a combination traceroute and ping functionalities. It is quite handy when diagonising network issues.

trip disruptivelabs.in

nnn > ranger > GUI file managers

Project page : https://github.com/jarun/nnn

Installation - https://github.com/jarun/nnn#installation

nnn is blazing fast and lightweight CLI file manager. I also like ranger as an alternative but nnn flow feels more natural and faster.

Socat > Netcat

Project page : http://www.dest-unreach.org/socat/

This one is might be a little obscure. I do security assessments and often I need to use tools that connect to different hosts/ports and also forward ports etc.

socat is an incredibly powerful tool for network relays, forwarding ports etc. It supports IPv6 and SSL. Socat has strange syntax but once you get hold of the syntax, you can do magic with socat.

jq

Project page : https://stedolan.github.io/jq/

Installation - https://stedolan.github.io/jq/download/

JSON has become defacto format for data exchange. jq is a command-line JSON processor which is quite handy while working with JSON streams. The syntax is a little tricky to get hold of though

curl -s 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq .

Tig ~ Git

Project page : https://github.com/jonas/tig

Installation - https://github.com/jonas/tig/blob/master/INSTALL.adoc

tig is a great compliment to git. tig makes git through CLI more intutive.

I use the following tig commands often -

  1. tig - equivalent of git log
  2. tig status - qquivalent of git status but cleaner and interactive
  3. tig refs - equivalent of git tag -n

Other mentions

  • i3wm Powerful, resource efficient, productive tiling window manager. The learning curve is steep but totally worth it. Customisation is the key.
  • Oh My Zsh Glorified Bash. I find that using zsh & Oh My Zsh make me relatively productive
  • Terminator Linux terminal on steroids with tabs, layouts and shortcuts etc
  • HTTPie curl for humans
  • direnv Manages directory specific environments
  • asciinema Tool to record and share a terminal session (Not videos)

References


Back to posts


comments powered by Disqus