Improving Command Line Productivity with GNU Readline

I spend a lot of my day working on the command line, from file navigation to version control to remote work on servers over SSH, and anywhere in between. I’ve found that even small improvements to my workflow significantly add up over time to provide big productivity boosts.
Read more on Improving Command Line Productivity with GNU Readline…

Five of My Favorite Command-Line Utilities

I spend a lot of time on the command line (generally, GNU/Linux), and often work on automating processes and tasks. My work often occurs on a remote machine to which I do not have access, and it generally must be headless (no GUI).

As a result, I have collected an arsenal of command-line interface (CLI) utilities that I always install when I’m setting up a new development machine for myself. There are often graphical analogues for these utilities, but I prefer these because of their CLI. Below is a sampling of my favorites. Read more on Five of My Favorite Command-Line Utilities…

Working with Text at the Command Line – Tools for Searching & Editing

I spend more time working with text than anything else. The multi-monitor, high-resolution graphics revolution hasn’t brought me graphics, just dozens of windows full of text. If you’re a software developer, chances are you are swimming in text too. Source code, documentation, configuration files, templates, logs–they are all searchable text. For special purpose tasks, like searching Java classes, I rely on my IDE, but for many things I run a command in a terminal. Read more on Working with Text at the Command Line – Tools for Searching & Editing…

A Tiny Toolbox for Spelunking through JSON

I rely heavily on local instances of a web or mobile application’s API during development. Since I also need to speak fluently with my data on live instances of the API, including both test and production, I’ve found that I often need to work with structured JSON data at the terminal rather than a Javascript-native environment like node.js or browsers. I’ve discovered how important the tools curl, bash, jq, and json-diff can be for this sort of work, so I’d like to share some ways they’ve been useful to me when wrangling JSON at the command-line. Read more on A Tiny Toolbox for Spelunking through JSON…

Tracking Down Disk Usage on the Command Line

When I bought my Macbook a few months ago, one of the hardware choices I made was to get a 128GB solid state drive with it. While I love the performance of my SSD, its small size has given me some problems when trying to manage my disk usage.

Disk Overload

A few days ago, I opened the activity monitor and was shocked to see that my machine was reporting less than 4 Gigabytes of free space left on my disk! The worst part was that I had absolutely no idea what was taking up all of that space. Was it all the downloads I had saved from Chrome? My music library?

Read more on Tracking Down Disk Usage on the Command Line…

An Introduction to Scripting Tmux Key Bindings

Tmux is a powerful terminal multiplexer, and its built-in support for scripting allows you to create new features according to your own workflow.

I spend most of my day in Tmux, at the command line, grepping through codebases and editing files with Vim. I copied and pasted or re-typed file names for a long time before I realized how irritated I was that I couldn’t merely click on a file name and immediately open that file to the given line.

An IDE would have that functionality, and being firmly in the camp of command line as IDE, I set out to right this wrong.

Read more on An Introduction to Scripting Tmux Key Bindings…

Handling JSON from the Command Line with Jq

In the battle of data formats, the two heavyweights are XML and JSON. Of late, JSON seems to be winning, in large part because most languages natively support JSON’s chosen data structures, but there’s one arena where JSON hasn’t made much of a showing: the command line. The command line provides a lot of programs to handle plain text (grep, cut, awk, and sed, to name just a few), and handling XML is even supported through xpath, but dealing with JSON has been the domain of standalone scripts written in Python, Ruby, or whatever your favorite language happens to be. There’s been few good ways to manage JSON directly from the shell. That’s why Stephen Dolan created Jq.
Read more on Handling JSON from the Command Line with Jq…

Using Haskell’s CmdArgs Package

I like to use Haskell to make little utilities for work. This can range from tools to analyze C code to code generation. When creating these utilities, the most tedious part for me is almost always the creation of some sort of command line interface to my code. Argument parsing is a pain in almost every language, and for some reason, it's always felt worse to me in Haskell.

Well, recently I discovered the CmdArgs package by Neil Mitchell. This package takes nearly all of the pain out of creating command line interfaces around Haskell applications. It takes about as much effort as Ruby's Thor library does to create something internally useful to your program and pleasing to the user.

Read more on Using Haskell’s CmdArgs Package...

Using Thor to Build a Command Line Interface

My first experience with Thor wasn’t great. I had heard that it could be used as a Rake replacement. Now, I have no problem with Rake (I like Rake!), but I’m always open to trying something new. I didn’t like the new thing.

Well, I didn’t like it until I tried to use Thor for what it claims to be good at (go figure). In fact, I much prefer Thor to something like Ruby’s OptionParser and other similar libraries. I can’t put my finger on exactly why, but I find command line interfaces I create with Thor much more aesthetically pleasing than other comparable libraries.

Read more on Using Thor to Build a Command Line Interface…