diskutil list

// finds out the location of your USB

diskutil eraseDisk JHFS+ BackupMaster disk2

// Here the command diskutil eraseDisk does the erasing, format is expressed as JHFS+ which is the Mac OS Extended (Journaled) and disk is named BackupMaster and the actual target disk is defined by its identifier disk2.