What is UNIX? – What you need to know

what is UNIX

In the ’80s and early ’90s, DOS and Windows were the only predominant operating systems. They were only accessible to those who could afford to buy a computer. This was a rarity back then. However, Innovations and advancements in software development spawned the rise of modern operating systems. At the turn of a new Century, multiple operating systems came along and found use across several devices. From PCs and smart devices to routers and game consoles. You can broadly categorize these systems into 2 families. On one side, we have Windows-NT based systems. On the other, we have Linux, macOS, iOS and Android which all trace back to UNIX. In fact, UNIX is the grandfather operating system from which most modern operating systems have descended.

So, What is Unix?

Unix is a multi-user and multitasking operating system developed in the 1960s in AT&T Labs. Software developers Ken Thompson and Denis Ritchie, who’s considered the father of C language, are credited for their valuable input in the development of the system which soon found its way in academia. One of the institutions that embraced UNIX is the University of California, Berkley where further development went on to spawn BSD a variant of UNIX. BSD ( Berkely Software Development ) inspired the development of other variants such as FreeBSD, NetBSD and OpenBSD.

These derivatives were later superseded by newer versions in the ’90s. These laid the groundwork for modern-day proprietary systems such as macOS, iOS. In fact, BSD code inspired the development of the operating system that powers the Sony PlayStation console. UNIX in its entirety would later be overtaken by Linux which was written from scratch. Being free and opensource, Linux was widely accepted by users and this gave rise to many popular modern flavors such as Fedora and Ubuntu. Linux is nowadays predominatly used in cloud platforms especially WordPress hosting.

What comprises UNIX?

UNIX operating system comprises 3 essential components:

  1. Kernel
  2. Shell
  3. File system

Kernel

The kernel is the core of the operating system. The kernel is loaded onto the RAM each time the system is powered on and detects all the available hardware components. These include the CPU, RAM, USB ports, and network interfaces to mention a few. It then provides the necessary software applications that enable these devices to communicate with the operating system and the various application software that is installed thereafter.

In summary, the kernel performs the following key functions:

  1. Main memory management – The kernel allocates the main memory to the running processes in the system.
  2. Task scheduling – It ensures all tasks carried out by the CPU are scheduled and executed as efficiently as possible.
  3. Data transfer management – The kernel also ensures the efficient transfer of data from one location to the other.
  4. Additionally, the kernel enforces access permissions already on the file system.
  5. Lastly, it accepts the commands from the shell and executes them.

Shell

The shell is a CLI ( command-line interface) that interfaces the kernel and the user operating the system. The shell provides a platform or environment for users to run commands and shell scripts. It accepts these commands and sends them to the kernel for interpretation and execution.

In a nutshell, the shell allows you to perform the following:

  1. Run commands and shell scripts.
  2. Command autocompletion by pressing the TAB key on the keyboard.
  3. View previously executed commands – The shell preserves a list of all commands executed by a user

There are 2 major shells in UNIX: Bourne shell and C shell. Variants of Bourne shell include:

  1. Bourne shell ( sh)
  2. Bourne Again shell ( bash )
  3. Korn shell ( ksh )

UNIX Filesystem

A filesystem, often abbreviated as fs, is a logical way of organizing and storing huge amounts of data for ease of storage and retrieval. In UNIX, all Information is stored and organized into files. A file is the smallest unit of data. It is in a file that data is stored and organized.

In UNIX Files come organized in a hierarchical directory structure. At the very top is the root directory ( / ) from which all the other directories descend from.

What is unix ?
Unix hierarchical system

Different types of files

We have already mentioned that files store data. Let’s take a look at the various types of files that exist on a UNIX system.

1) Ordinary files

Ordinary files are files that contain text, images, videos or instructions. These are the files that you would normally interact with on a day-to-day basis. When listed using the ‘ls -l‘ command, they are prefixed by a hyphen symbol ( ).

2) Symbolic links

Symbolic links are special types of files that reference other files. A symbolic link, also known as a soft link, contains text that includes the path to the referenced file.

3) Special files

These are files located in the /dev directory. They represent physical devices such as disk drives, CD ROM and printers. They come in handy in Input-Output operations.

Wrapping up

We have covered the basics about what a UNIX system is and what makes up the operating system. It’s from UNIX that other systems such as Linux and Android have transcended. UNIX is still in use in special cases such as powering special internet servers. However, its usage is on the decline and Linux has largely taken its space especially in DevOps and cloud hosting platforms.