The Unix Toolbox

This article originally appeared in the December 2013 issue of PHP Architect

The beauty of a Unix-based operating system is that it has a multitude of useful tools that most people don't know about. You can use them on their own, chain them together, you can do almost anything you can think of.

We'll take a look at some popular tools and some lesser known gems. As well as tools, we'll cover tips and tweaks for making your command line do all the work so that you don't have to. From search and replace to installing software without having to find it first, the command line can do it all!

[ Read More ]

A better git diff

Whitespace is like git diff's krypton, it makes changes that are actually tiny look much more complicated than they actually are. Thankfully, git comes with a few flags that you can use in conjunction with git diff to make life a bit easier.

The first option is --ignore-space-at-eol. This flag makes git diff ignore any changes to whitespace at the end of a line. Most developers have options to automatically trim trailing whitespace, but if you're working in a team that doesn't have it enabled you might find this option useful.

[ Read More ]

jq - sed for JSON

I can't remember the last time a day went by that I didn't end up working with JSON data. It's a lovely format to work with, but unfortunately due to how verbose it is it can be quite difficult to extract the specific details that you're looking for.

jq is a standalone binary for working with JSON. Just download it, put it in your $PATH and get to work. It has all kinds of options available, but I tend to use it just for filtering data.

[ Read More ]

Vim Tips

I've been using vim for a while now, but with Vim being Vim, there's always new things to learn. Thanks to Jacek, I've learned a few more things recently.

[ Read More ]