Arduino from the command line

How to compile Arduino code from the command line.

Martin Oldfield, 29 Dec 2013