So you've downloaded El Capitan from the App Store to your Mac. The installer is sitting in your Applications folder. And now you want to create a bootable USB stick that can be used to perform a clean installation of the operating system on another system. Here's what you do.
Insert a USB stick into your Mac. It will be trashed, so make sure you take a copy of anything important.
From Terminal, list the connected disks, and identify the path to the USB stick:
diskutil list
Format the disk and set a label of Untitled (replace
/dev/disk4
with the relevant path identified during the previous step).sudo diskutil eraseDisk JHFS+ Untitled /dev/disk4
Copy El Capitan to the USB stick, and make it bootable:
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
Plug the USB stick into another Mac, power it on whilst holding down the Option key, and proceed with the installation.