I overwrote OSX with Linux by accident So here is what happened. I installed Ubuntu onto a flashdrive hoping to be able to dual boot Linux/OSX. I burned Ubuntu onto the flash drive on my desktop PC (windows 8.1) with universal USB installer, I believe. I plugged it into my Mac OSX, rebooted, held the option key, and booted from the flash drive (it recognized it as "windows" by the way). 

It then started to install and I must have somehow clicked install onto the hard drive because now both my hard drive and my flash drive are Ubuntu (both recognized as "windows" in the boot screen) and I really need to get my Mac OSX back. 

I get this screen every time I boot from the hard drive then get stuck at a blank (looks terminal-ish) screen which doesn't load. 

&nbsp;&nbsp;&nbsp;

I can boot from the flash drive and get this.

&nbsp;&nbsp;&nbsp;

It at least boots into Ubuntu. 

&nbsp;&nbsp;&nbsp;

I'm really not experienced with Ubuntu and I really don't want to have to keep Linux, so please if anyone can help me I would appreciate it.

p.s like I said earlier I have a windows 8.1 PC, so I can use that to help fix it if necessary I just really need my OSX back.

If you need any more information I'll gladly give it. Here is what it looks like with my flashdrive plugged in when I choose where to boot from.

&nbsp;&nbsp;&nbsp;

Reference


Need help with linux/restoring to osx!
It sounds like you don't have a backup of your original OS X setup, and since you also likely don't have the Recovery partition, you can reinstall in the following way from scratch (assuming you have a relatively recent machine):

See How to use macOS Recovery for reference - but the relevant steps are below:

macOS / OS X Internet Recovery


Restart your Mac, and hold down Command + R at startup until the Apple logo appears. 


After your computer finishes starting up, you should see a desktop with an OS X menu bar and an OS X Utilities window with the options listed above. If you see a login window or your own desktop instead of the Utilities window, it's possible that you didn't press Command-R early enough. Restart your computer and try again.

Choose the option you want to use from the Utilities window or the Utilities menu.

In order to reinstall OS X, you need to be connected to the Internet using Ethernet or Wi-Fi. If you're using a wireless Internet connection, click the Wi-Fi menu in the upper-right corner of the screen to select a nearby Wi-Fi network. Choose your preferred network name and enter a username and password to join the network if needed.