It's for Yosemite but I'm fairly sure it will scale up.
https://coolestguidesontheplanet.com/making-a-boot-usb-disk-of-osx-10-10-yosemite-via-terminal-and-gui/
Let us know how you get on
P
Hello everyone,
I am in need of help. My wife's iMac (2.4ghz, 24", I think from 200
boots in loop.
I went into Recovery mode, and the disk is fine but OSX needs to be reinstalled. Internet Recovery does not work, apparently due to a firmware issue. We get past the part where it asks for the Apple ID, and it accepts it, but then gives an error about the OS.
I have the DMG file for the same OSX version she has installed, El Capitan, from another Mac we have. I attempted to make a bootable USB from Windows, however when going to Boot Options menu (Option key during boot-up) it doesn't show the USB, only Recovery and Macintosh partitions.
I am wondering, what can I do to get this working? Am I able to start the reinstall from the terminal console in Recovery Mode? Is it possible for me to put the DMG file on another USB drive, boot into Recovery Mode, and then make a bootable USB from Disk Utility within Recovery Mode on a second USB drive?
I found these notes about starting the install from the Terminal Console in Recovery Mode, but I am not sure if they apply?
Try this find the InstallESD.dmg inside the Install OS X Mavericks.app should be in the SharedSupport dir and mount it, then find the BaseSystem.dmg inside the mounted OS X InstallESD and mount that. then run the cmd sudo /Volumes/OS\ X\ Base\ System/System/Installation/CDIS/OS\ X\ Installer.app/Contents/MacOS/OS\ X\ Installer /Volumes/OS\ X\ Install\ ESD/Packages/OSInstall.mpkg you might have to prefix the volume you want to install onto at the end of the command cant quit remember but I have used this cmd before to install OS X from the terminal.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic