Here is a few sample examples of how to format a drive in Terminal.
Click Applications > Utilities > Terminal.
Always run Diskutil list. This will show you the list of the drives on that computer which will help you identify which drive name is needed to for the DiskNoteID at the end of the terminal command.

Formatting a Disk to Mac OS Extended Journaled (JHFS+) from Terminal in Mac OS X
diskutil eraseDisk JHFS+ DiskName /dev/DiskNodeID

