04. Linux System Overview

The Linux Operating System contains a slew of pieces: hardware connections, partition space, boot loaders, processes, terminals, window management system...phew! It can be overwhelming to think about all these bits and pieces; let's try breaking it down to three main components.

1) Hardware

The first piece to creating any computer is assemblying its hardware. Here are just some of the components that go into a computer:

Physically holds the components together. A special firmware called the BIOS controls all connections.
The Central Processing Unit acts as the main "brains" of the computer. It executes all mathematically-related tasks.
Stands for Random Access Memory, but also known as main memory or just memory. This is the space that currently running processes are loaded on; the bigger the RAM, the more processes are able to run simultaneously.
Buses and ports
Connects devices and sends/retrieves information to and from hardware.
The motherboard of a system connects all of a computer's components together
A motherboard with all its core components labeled.

If you're interesting in learning in much more detail about computers, try building your own PC. There's no better learning experience than being hands-on!

2) Kernel

The kernel is the software residing in memory that takes user commands and passes them onto the hardware for execution. This is often referred to the core of the OS, as it connects hardware to the user interface and processes. We'll learn more about the kernel and its functions on the next page.

The Shell

The interpreter that allows us to communicate with the kernel through commands is known as the shell. This is the lowest-level interface that a user can utilize to communicate with the computer.

There are several types of shells that you can choose from. They differ mainly in syntax and have operational features. The most common is bash which serves as the default on most machines.

A list of shells are stored in your /etc/shells file.

$ cat /etc/shells
/bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh
bourne again shell
c shell
korn shell

The shell also provides you with a list of commands and syntax that allow you to write shell scripts. Shell scripts are reuseable lines of codes a accomplish some task. Shell scripts are a good way to create programs that are portable to another Linux machines.

3) Processes, Applications and Programs

Lastly, we have processes (aka applications or programs), which give the kernel tasks to perform. After the user assigns or opens several processes, the kernel decides how to delegate the hardware resources to simultaneously run the programs. It is these processes and applications working in conjunction with a kernel that make up UNIX and UNIX-like Operating Systems.

Kernel of an OS takes the higher level commands and translates it to computer language
How hardware, the kernel, and applications all tie in together to build the Linux Operating System.


At the very top-level abstraction in this system are users - entities that may own files and run processes. Each user has a username and a user id, the latter of which is used by the kernel. Groups contain sets of users.

The root user (aka superuser) is in control of the system - they are able to shut down any user processes and access any file on the system. Some adminstrative commands may only be used by the root user. To switch to root, use the su command.

User and Kernel Spaces

RAM (Random Access Memory) can be separated into two distinct regions - the user space and the kernel space. The main difference between the two is their privileges on operating system functions and restrictions on user applications.

User Space

The processes run by ordinary users (aka user processes) are stored in the user space. The user space is the memory that is allocated by the kernel for user processes. The separated of the user and kernel space guarantees that no user-created process steps out of bounds, which could cause system crashes or memory overflow.

The area in which processes and normal programs are run in is known as the user space. The user space is more limited to what it can access, with restrictions on memory and CPU-safe operations. A broader term encompassing this is known as sand-boxing, which restricts user programs such that they don't mess parts of memory owned by other processes. This is a good thing, as it prevents the system from crashing in case something goes haywire.

Kernel Space

The kernel has its own special privileges that allow it access to all pieces of the CPU and memory. This area of control is known as the kernel space, which is where the kernel delegates all its tasks.

Note that the separation between user and kernel spaces allow for the computer to run smoothly and avoid any malfunctions. Additionally, anything that goes haywire in the user space can easily be fixed by the kernel.

Take your Linux skills to the next level!

Command Line Kung Fu

Take your Linux skills to the next level! Try Linux & UNIX

Command Line Kung Fu is packed with dozens of tips and practical real-world examples. You won't find theoretical examples in this book. The examples demonstrate how to solve actual problems. The tactics are easy to find, too. Each chapter covers a specific topic and groups related tips and examples together.

$ Check price
14.9914.99Amazon 4.5 logo(27+ reviews)

More Linux & UNIX resources

Want to avoid becoming a code monkey?

Pragmatic Thinking

Want to avoid becoming a code monkey? Try Good Practice

Programmers have to constantly learn new concepts and technologies. In this book by Andy Hunt, you'll learn how our brains are wired, and how to take advantage of your brain's architecture to make the most of your learning. You'll learn new tricks and tips to learn more, faster, and retain more of what you learn.

$ Check price
34.9534.95Amazon 4.5 logo(86+ reviews)

More Good Practice resources