Small differences on OS X

20 Dec '15

After getting used to the keyboard, I find the second biggest stumbling block when moving between Linux and Mac (and BSD) is all the small differences in command line utilities. For me, the most noticeable omission since Mac OS X Mountain Lion is that the grep shipped with OS X doesn’t support regular expression searches via grep -P. Come on Apple!

Luckily, if you’re a developer using a Mac, then you’ll already have homebrew installed as the first step of bringing up a new machine. Then you can simply install GNU coreutils and binutils with the flag --with-default-names, which I strongly recommend. This will let you instantly start using the GNU utilities.

(This does rely on the fact that you’ve set up your $PATH variable correctly, with the default homebrew location /usr/local/bin being listed in front of /usr/bin, but I think this is default/recommended behaviour anyway.)

Mac, OSX, Linux

Newer Older