Assuming:

  • “Install OS X Yosemite.app” is located in the “Applications” folder
  • USB stick has been erased/formatted and labelled UNTITLED
  • USB stick is 8GB or larger

Run the following:

sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/UNTITLED/ --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction