Really handy tip this one, via the mactricksandtips.com website. See here: http://www.mactricksandtips.com/2010/06/converting-files-in-terminal-including-docx.html

For the impatient, the cli programme that weaves this magic is called 'textutil'.