Essential Command Line Tools

The following is a curated list of essential plugins and command line tools to improve your productivity. This is largely for Unix or Linux based systems, for now.

z - jump around

Z

Tracks your most used directories, based on ‘frecency’.

After a short learning phase, z will take you to the most ‘frecent’ directory that matches ALL of the regexes given on the command line, in order.

For example, z foo bar would match /foo/bar but not /bar/foo.

Z

A good alternative is jump.

NeoFetch

Neofetch

Neofetch is a command-line system information tool written in bash 3.2+. Neofetch displays information about your operating system, software and hardware in an aesthetic and visually pleasing way.

Neofetch

The overall purpose of Neofetch is to be used in screen-shots of your system. Neofetch shows the information other people want to see. There are other tools available for proper system statistic/diagnostics.

You can further configure Neofetch to display exactly what you want it to. Through the use of command-line flags and the configuration file you can change existing information outputs or add your own custom ones.

A guide to installation on Github. The settings I use on OS X for Neofetch: Settings.

zsh

zsh

A delightful community-driven (with 1500+ contributors) framework for managing your zsh configuration. Includes 200+ optional plugins (rails, git, OSX, hub, capistrano, brew, ant, php, python, etc), over 140 themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

The settings I use for zsh: Settings.

wttr.in

zsh

wttr.in is a console-oriented weather forecast service that supports various information representation methods like terminal-oriented ANSI-sequences for console HTTP clients (curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers.

I made an alias for getting NYC’s weather like so:

alias weather="curl wttr.in/nyc"

ripgrep

ripgrep

ripgrep is a line-oriented search tool that recursively searches your current directory for a regex pattern. By default, ripgrep will respect your .gitignore and automatically skip hidden files/directories and binary files. ripgrep has first class support on Windows, macOS and Linux, with binary downloads available for every release. ripgrep is similar to other popular search tools like The Silver Searcher, ack and grep.

I made an alias for searching through typical web-based files quickly:

alias rgweb="rg --type-add 'web:*.{html,css,scss,js,php}'"

nvm

nvm

nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL. Further, this allows you to have different versions of node and npm per project per shell.

fzf

fzf

fzf is a general-purpose command-line fuzzy finder. It’s an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.

fd

fd

A simple, fast and user-friendly alternative to ‘find’. While it does not seek to mirror all of find’s powerful functionality, it provides sensible (opinionated) defaults for 80% of the use cases.

jq

jq is a lightweight and flexible command-line JSON processor. jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text. There’s amazing documentation over at the developer’s website.

ffmpeg

ffmpeg

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata. This can be used to play, download, convert, stream media-based content. In this post, I used FFmpeg, with gifsicle, I convert .mov screencasts into .gif images (like the one for fzf above).

ffmpeg -i in.mov -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

wget

GNU wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc. Nice, pretty, human readable syntax compared to cURL.

An awesome alternative: httpie. HTTPie (pronounced aitch-tee-tee-pie) is a command line HTTP client with the goal of making CLI interaction with web services as human-friendly as possible. It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. HTTPie can be used for testing, debugging, and generally interacting with HTTP servers.

One of my favorite wget commands:

wget -m https://example.com

This creates a mirror of a website with Wget. It creates a complete local copy of the website by following and downloading all internal links as well as the website resources (JavaScript, CSS, Images).

For further instruction on wget, Linuxize has a great set of examples.

bat

bat

bat supports syntax highlighting for a large number of programming and markup languages. It can pipe its own output to less if the output is too large for one screen. bat communicates with git to show modifications with respect to the index (see left side bar). It integrates with find, fd, ripgrep, tail, git, xlip, man, prettier, etc.

mdcat

mdcat

cat, but for Markdown. mdcat works best with iTerm2 or a compatible terminal emulator, and a good terminal font with italic characters. Then it nicely renders all basic CommonMark syntax (no tables or footnotes though), highlights code blocks with syntect, shows links and images inline in supported terminals, adds jump marks for headings in iTerm2 (jump forwards and backwards with ⇧⌘↓ and ⇧⌘↑).

exa

exa

exa is an improved file lister with more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary.

watch

procps is a set of command line and full-screen utilities that provide information out of the pseudo-filesystem most commonly located at /proc. This filesystem provides a simple interface to the kernel data structures. The programs of procps generally concentrate on the structures that describe the processess running on the system. watch is included in this bundle. Basically run scripts or execute programs periodically, based on paramaters, showing all output to the terminal.

vim

vim

Vim is a highly configurable text editor for efficiently creating and changing any kind of text. It is included as “vi” with most UNIX systems and with OS X.

Add to .zshrc or .bashrc to set default editor for local and remote sessions.

if [[ -n $SSH_CONNECTION ]]; then
    export EDITOR='vim'
else
    export EDITOR='mvim'
fi

Some alternatives are emacs, spacemacs, spacevim, neovim, and nano.

htop

htop

htop is interactive process-viewer and process-manager for Linux and Unix-like operating system based on ncurses. If you take top and put it on steroids, you get htop.

vtop

vtop

Similar to htop or top or atop, but prettier. A graphical activity monitor for the command line. I use this one on my local machines, on servers I use htop.

youtube-dl

youtube-dl

youtube-dl is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter (2.6, 2.7, or 3.2+), and it is not platform specific. We also provide a Windows executable that includes Python. youtube-dl should work in your Unix box, in Windows or in Mac OS X.

ufw

UFW, or uncomplicated firewall, is a frontend for managing firewall rules in Arch Linux, Debian or Ubuntu. UFW is used through the command line (although it has GUIs available), and aims to make firewall configuration easy (or, uncomplicated).

nmap

Nmap (“Network Mapper”) is a free and open source (license) utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.

googler

googler

googler is a power tool to Google (Web & News) and Google Site Search from the command-line. It shows the title, URL and abstract for each result, which can be directly opened in a browser from the terminal. Results are fetched in pages (with page navigation). Supports sequential searches in a single googler instance.

itermocil

itermocil

iTermocil allows you to setup pre-configured layouts of windows and panes in iTerm2, having each open in a specified directory and execute specified commands. You do this by writing YAML files to save your layouts. If your using session restoration or saved window layouts in iTerm, you should find iTermocil is a nice upgrade on that.

iTermocil supports iTerm 2.x and the new 3.x (including later betas). It works better with the new 3.x versions which have improved Applescript support.

tmux

tmux is a terminal multiplexer. Similar to iTerm, or rather iTerm is similar to tmux, it lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.

ender