Backstory: I intended to make an ubuntu bootable usb for my iMac but somehow seemed to wipe my MacHD and now ubuntu is the default operating system. It seems that I've lost the ability to 'CMD + R' into apple recovery as it doesn't work. I was able to get to a gnu grub menu with advanced options taking me to a root terminal. I didn't proceed but was wondering if there is a way to put OSX back on from this grub menu. Thanks.
11 Answer
If you have wiped your boot drive you will need to reinstall MacOS from scratch. Once a disk is formatted there's no turning back and unfortunately all data will be lost.
When installing anything directly to a USB stick you should disconnect all other disks to prevent accidents like this.
EDIT: Ubuntu can run as a live USB by simply writing the Ubuntu Live ISO to the USB just like you would if you wanted to use it as an installer. You don't need to install it directly to the USB unless there is some special reason to do so (e.g. my server boots from a USB install of Ubuntu Server).
2