Create an USB install drive (OSX Mojave)

You just need to download -in this case- Mojave OS in your HD. Once you’ve download, connect an USB flash drive (more than 8GB storage) and run:

sudo /Volumes/miguel/Software/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/CHEMA --nointeraction

where /Volumes/miguel/Software is the OS folder location and /Volumes/CHEMA is the USB