Way back in 1983, Richard Stallman initiated the GNU Project, which was a recurring acronym for “GNU is Not Unix.” His idea was to make an operating system free from all commercial restrictions – one that is free, which can be freely tweaked, modified and used. There was just a small restriction: if you modified the code, you have to make it available freely and you would have to cite the original developer. He wanted this operating system to be UNIX-like and POSIX compliant. The operating system kernel, hurd, did not attract much attention, but the GNU project, allowing free use and modification of the software did.
Years later, Linus Torvalds was using MINIX for his academic studies. MINIX was a system developed by Andrew Tanenbaum to teach UNIX in schools. The source code of MINIX was available but the distribution license did not permit changes and modifications. And this MINIX could not exploit his PC’s full potential. He wondered why he didn't just write his own program to access his university’s (University of Helsinki) servers.
This thought turned into a simple terminal emulator which he began to use. Torvalds developed the terminal emulator in C and compiled it with the GNU C Compiler. But the terminal emulator would evolve into a kernel, and the kernel into a giant operating system.