Download the desired version of Ubuntu
Convert the .iso file format into an .img file
hdiutil convert -format UDRW -o ~/Path-to-IMG-file ~/Path-to-ISO-file
When the image file is complete it will actually end up as a .dmg file.
Get the device number and unmount the USB drive
diskutil list
Usually the last disk connected will show up last in the list, ie /dev/disk3 or /dev/disk3
Then unmount the USB disk with the following command where N indicates the number found with the previous command.
diskutil unmountDisk /dev/diskN
When the disk unmounts a confirmation message will appear.
Unmount of all volumes on disk12 was successful
Create a bootable USB drive from the Ubuntu image
To create the disk, issue the following command. Note when writing to the disk path we will prepend the disk name with an r to indicate raw transfer.
sudo dd if=/Path-to-IMG-DMG-file of=/dev/rdiskN bs=1m status=progress
When the USB disk creation is complete your operating system may prompt you that a new disk was inserted. Do not Initialize, Ignore or Eject it just yet. Return to the terminal and eject the USB drive by running the command:
diskutil eject /dev/diskN