following smae method for El Capitan
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/ElCapitan
hdiutil resize -size 8g /tmp/ElCapitan.sparseimage
hdiutil attach /tmp/ElCapitan.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/install_build
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/install_build
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/install_build
hdiutil resize -size `hdiutil resize -limits /tmp/ElCapitan.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/ElCapitan.sparseimage
hdiutil convert /tmp/ElCapitan.sparseimage -format UDTO -o /tmp/ElCapitan
rm /tmp/ElCapitan.sparseimage
mv /tmp/ElCapitan.cdr ~/Desktop/ElCapitan.iso
If you prefer to make a bootable dvd, you can do it this way:
After downloading the full ElCapitan installer app from the Mac App Store, run these 14 commands in Terminal to create a ElCapitan.iso file and then burn it to a dual layer DVD with Disk Utility. You may then boot up from it by holding the option key down and then install ElCapitan.