How do I format a disk partition from the command line on OS X?
diskutil list

In my case I wanted to format the parition as NTFS for installing Windows 7 on it. The last parameter is the partition 4 on first disk.

diskutil eraseVolume "Tuxera NTFS" my-ntfs disk0s4