In the 1960s AT&T Bell Labs, the Massachusetts Institute of Technology, and General Electric joined efforts to develop an experimental operating system called Multics. It took several years to develop Multics (1965 – 1968) but the result was not succesful and AT&T Bell Labs pulled out of the project in 1969.
Ken Thomson (from Bell Labs) could get an unused DEC PDP-7 machine where he ported his favorite Multics game (Space Travel). He developed the tools he had been using on Multics for the PDP-7, then he built a kernel, a file system, an editor and a shell using the B programming language.
According to Thompson:
It was the summer of '69. In fact, my wife went on vacation to my family's place in California.... I allocated a week each to the operating system, the shell, the editor, and the assembler, to reproduce itself, and during the month she was gone, it was totally rewritten in a form that looked like an operating system, with tools that were sort of known, you know, assembler, editor, and shell.... Yeh, essentially one person for a month.
After developing this basic environment, Dennis Ritchie and others joined and they started to enhance the basics: kernel, device drivers, file system. They included a command interpreter and other utilities. The project was called UNICS (Uniplexed Information and Computing System), a hack on Multics. The name was later changed to UNIX.