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

In case someone wonders why: because for some people Disk Utility fails.
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