A Journey Through the Evolution of the Command Line Terminal

The World Of Operating Systems

Most operating systems can be grouped into two families:

  • The Microsoft NT descendants including Windows, Xbox OS, and Windows Phone/Mobile

  • Pretty much everything else has a lineage going back to Unix, including Mac OS X, Linux, Android, Chrome OS, and even the PS4 OS. For eg, the du command will execute on both Ubuntu and MacOSX regardless of which descendant OS you run.

    For more information, you can also refer to a detailed OS Family Tree

So What Is Unix?

Unix was an operating system developed at Bell Labs in the mid-1960s. Many of the innovations and design choices the original Unix team have lived on 50+ years later, including the idea of multi-user operating systems and hierarchical file systems.

Unix is the "grandfather" of many modern operating systems that we frequently use today.

The Unix Philosophy

In the early days of computers, operating systems were tightly tied to specific hardware. Unix decoupled the two and was easily portable to other hardware.

Unix's philosophy emphasizes modular software design and the creation of small individual programs that can be combined to perform complex tasks. We can visualize them as Lego pieces that can be used as building blocks that can be combined to perform complicated tasks.

  • Write programs that do one thing and do it well.

  • Write programs to work together.

  • Write programs to handle text streams, because that is a universal interface.

True Unix vs Unix-Like

Today the name "UNIX" is a trademark of a global consortium called The Open Group. They maintain a set of standards called the Single UNIX Specification, which describes the core commands, features, interfaces, utilities, and more that define a UNIX operating system.

The Open Group will certify an operating system as fully UNIX compliant if it passes conformance tests. Companies must pay to be tested and must further pay to use the UNIX trademark. For eg, MacOSX is a true Unix

Many operating systems are based on the original UNIX operating systems and are compatible with the UNIX standards, but are NOT considered UNIX because they have not been certified by The Open Group. Often this is because of financial considerations or ethical objections. They follow the rules but are not recognized by The Open Group.

We call these operating systems Unix-like. They fully or mostly meet the specification but cannot legally use the UNIX name.

If you want to explore the Original Unix manual, you find it here

Linux, GNU, Kernels, Oh My!

GNU

Richard Stallman was a leader in the group of developers who aimed to create Free Software alternatives to Unix.

In 1984 he began work on the GNU Project, to create an operating system that included "everything useful that normally comes with a Unix system so that one could get along without any software that is not Free"

The Linux Kernel

Another developer, Linus Torvalds, was working on creating his kernel known as Linux. The kernel is the part of an OS that facilitates interactions between hardware and software.

At the time, many GNU "pieces" were complete, but they lacked a kernel. Torvalds combined his kernel with the existing GNU components to create a full operating system.

What is a Kernel?

A kernel is a computer program that forms the core of an operating system and manages critical tasks like:

  • memory management

  • task scheduling

  • managing hardware

While a kernel is a critical piece, it is NOT the same as an operating system. An engine is the essential "core" of a car, but you can't drive an engine on its own!

Linux

Today, the term "Linux" refers both to the kernel created by Linus Torvalds AND all the software that is part of the Linux ecosystem.

Some developers feel strongly that the name GNU/Linux should be used instead, as it properly reflects the GNU Project's contributions. However, Richard Stallman said "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 more information, you can refer to this article

Linux Distributions

The Linux Kernel itself is not a full-blown operating system. When people talk about a Linux-based operating system, they are referring to Linux distributions.

Typically, a Linux distribution bundles together the Linux kernel, GNU tools, documentation, a package manager, a window system, and a desktop environment.

There are nearly 1000 Linux distros available. Some of the more popular ones include Fedora, Ubuntu, and Debian.

Explaining Terminals, Shells, & Bash

Shell

A shell is a computer interface to an operating system. Shells expose the OS's services to human users or other programs.

The shell takes our commands and gives them to the operating system to perform.

It's named a shell because it is the outer layer around the OS, like the shell around an oyster!

Terminal

A terminal is a program that runs a shell. Originally, terminals were physical devices, but these days we work with software terminals.touch ❯ group-{a..e}.txt

So the process is we type stuff into the terminal. We hit enter terminal handset over to the shell. The shell then takes our commands and hand them over to the OS to perform and then it goes vice versa and we'll see some result.

Bash

On most Linux-based systems, the default shell program is Bash. There are many other shells, but Bash is currently the most popular.

The name "Bash" is an acronym for "Bourne-Again SHell", a punny reference to Stephen Bourne, the creator of Bash's direct ancestor shell, sh.

Bash runs on pretty much every version of Unix and Unix-like systems.

Did you find this article valuable?

Support Mustafa's Blog by becoming a sponsor. Any amount is appreciated!