My WordPress Toolbox

Thought I’d share this with you. Here are the commands I use to “do work” on WordPress.

Connect to a remote machine (usually I do development on my laptop, locally, but sometimes I’ll work from another computer):
$ ssh -l remote_username

Make a directory:
$ mkdir /path/to/wordpress/

Browse to the WordPress directory:
$ cd /path/to/wordpress/

Use SVN to download the latest WP code to the current directory (which from now on, assume is /path/to/wordpress/):
$ svn co .

Update existing SVN checkout to latest code:
$ svn up

Search WordPress for a string (‘function the_content’ in this case):
$ grep -iR 'function the_content' *

Edit a file using nano:
$ nano filename.php

Make a patch, for filename.php:
$ svn diff filename.php > filename.diff

Make a patch for all files modified in the checkout:
$ svn diff > big_patch.diff

Apply a patch from someone else:
$ patch -p0 < patch.diff

My main text editor is TextMate for OS X, but I’ll use nano if logged in to a remote system. Note that all these commands work for OS X and Linux (you’ll need svn installed… check out Fink for OS X which gives you apt-get and a bunch of nice Linux-y goodness).

Update: Peter Westwood has a tutorial for Windows users, which I recommend (I used to do development on Windows, and I used the tools that he recommends!)