How to mount .dmg in Terminal

# mount .dmg
hdiutil attach ./SomeFile.dmg
# unmount .dmg
hdiutil detach /Volumes/SomeVolume