Part 1: Demystifying Unix & Linux

Devanshu Tiwari
4 min readDec 7, 2020

In these four parts i will try to cover all the essentials of UNIX, that a beginner needs to know.

Part 1: Demystifying Unix & Linux
Part 2: Linux OS Basics
Part 3: Basic Linux Commands
Part 4: Shell Scripting in Linux

Unix vs Linux : What the hell is this POSIX?

DEC’s PDP-7, 1965

The image contains a PDP-7 mini-computer developed by DEC(Digital Equipments Corporation) in 1965, for which the UNIX Operating system was written by Kenn Thompson and Dennis Ritchie at Bell Labs. First time in history, an OS had multi-user and multi-tasking capability. Unix’s popularity rose when it was refactored using C making it portable.

Its modular philosophy and portability, took it beyond Bell Labs to academics, research and commercial use. It was UNIX, which stared piping i/o of programs to a linear set of operations on input (Piping: Using output of one command as a input to another command, `|` symbol is used to achieve this).

In 1970’s , a new Unix distribution became popular in academics, specifically at Berkeley, from where the “Berkeley Software Distribution (BSD)” came. The C shell and vi programs were added to Unix at Berkeley making BSD more useful and versatile. Interestingly, Apple’s OS-X (now known as macOS) is a also a derivative of BSD.

Unix’s commercial success reached new heights in 1980s to 1990’s with coming of many commercial distros (short for distributions) like Sun Solaris, Xenix, HP-UX, IBM’s AIX, Sequent etc. People called it an era of “UNIX-wars”. With so many versions of Unix out there, standardisation was inevitable. It was then , The Open Group came with the POSIX standard in 1988.

The rise of Open Source : Richard Stallman’s “GNU movement”

GNU to Linux= You complete me!

GNU is a recursive acronym for ‘GNU’s not UNIX’ coined by Richard Stallman who proposed a free alternate open source OS, against the contemporary proprietary Unix. He had written GNU tools (like gcc) but without a kernel the dream of an OS was distant. But luckily, Linus Torvalds that time was working on a project popularly known as The Linux Project (Linux Kernel) Contrary to the popular belief that Linux is an Operating system, the term Linux actually refers to the Linux Kernel. In addition to MIT’s X-Window GUI , these two were a perfect match for each other and later amalgamated to become the most successful and popular OS of all time- “The Linux OS”. This Linux revolution gave birth to hundreds of distros , including Canonical’s Ubuntu, Red Hat Linux, Fedora to name a few. From Android to almost all embedded systems like smart-watches, smart-TVs, washing machines etc use some variant of Linux as their Operating System . Even Raspberry’s Pi, which is an OS platform for IoT Devices, is based on Linux. And lets not forget the majority of cloud services and servers still rely on Linux. Still not convinced? Google `WSL` 😆

What is the relationship between Kernel, Shell and Hardware?

Kernel and Shell in OS

Kernel: “It is a portion of a Operating system’s code that always resides in memory”. What this means is that the kernel has exclusive control over hardware, as it has direct access to it. As evident from the above diagram, if you need to communicate with hardware you need to communicate to the kernel first. It sits between you and the hardware. Most kernels uses two modes : The user mode and the kernel mode. In kernel mode the executing code has unrestricted access to the hardware, on the other hand in user mode it need to access the hardware using system API’s. This isolation helps in keeping the system running even when some part of it meets a crash.

Shell: Shell provides us a environment to run commands. Mostly it starts with a prompt `$` which means it is ready to accept a command. After you press Enter it reads your command and executes it if there is no error.
Some popular shells that you may encounter are : korn shell(ksh), bourne-shell(sh),bourne-again shell (bash), z-shell(zsh) etc.

In the next part, we will see how beautiful a shell can be! Till then, have an adventurous day… 😉

--

--

Devanshu Tiwari

If you can’t explain it simply, you don’t understand it well enough