I am not a historian by any means. Please take this with a grain of salt.
UNIX was an operating system created for/by AT&T at Bell Laboratories by many people. Most notably/famously, Dennis Ritchie and Ken Thompson. It was an operating system "for programmers, by programmers". It was meant as a developer's platform. I believe it was written in C (although early version may have been in assembly). It served as a base for many operating systems to come, introducing suck things as built-in manuals (man pages), a shell interpreter (first the Thompson shell, then the Bourne shell, then the Bourne-Again Shell (BASH), which we all know and love), and early versions of file systems etc. It also implemented a now-ubiquitous build environment, using
make It should be noted that UNIX was the whole package: An operating system, kernel (roughly: the layer between your hardware and your programming languages/software), and programs.
Now fast forward a bit. A lot of people tried UNIX and thought "I need to have this at my place of research/school/business". However, it was not explicitly clear how licensing was to work. So, rather than dealing with all that, several people set out to create open-source versions of UNIX. One such example is MINIX, by Andrew Tanenbaum. Another example is the GNU project, created by Richard Stallman (although his version didn't start until 1983). Of course, we all know which ended up being the big winner: Linux, created by Linus Torvalds. Technically, Linux is just a kernel. Most of the software tools on Linux "distributions" (also called distros) is from the GNU project . So it's a bit of a misnomer to call Ubuntu/Debian/Fedora (etc) a "Linux operating system". However, this was a subject of controversy from Richard Stallman.
One quote from Stallman goes: "Calling the whole system "Linux" leads people to think that the system's development was started in 1991 by Linus Torvalds. That is what most users seem to think. The occasional few users that do know about the GNU Project often think we played a secondary role — for example, they say to me, 'Of course I know about GNU — GNU developed some tools that are part of Linux'".
Of course, this mention wouldn't be complete without the mentioned another quote, in which he famously said: "I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. "
So nowadays, "Linux" distros are really made of a Linux kernel, systemd for initialization of hardware, GNU software tools, and a windowing system (Called the X Windowing system).
I hope that helps clear it up.
As a bonus, here is an interesting video from Computerphile (great channel, I recommend subscribing) about UNIX:
https://www.youtube.com/watch?v=-rPPqm44xLs
http://www.gnu.org/gnu/thegnuproject.en.html