Linux Explained: Distributions, Terminals, and Everyday Use

Linux powers virtually every public cloud server, supercomputer, Android smartphone, and submarine networking router. Here is how the kernel interacts with userland tools, the filesystem, and process execution.

Linux terminal shell session on laptop screen
Figure 1: POSIX command-line interface: executing kernel diagnostics and system services.

1. The Kernel vs. GNU Userland

Strictly speaking, Linux is not an operating system; it is a kernel. The kernel is the core software program responsible for managing physical hardware resources: allocating CPU time, managing virtual memory pages, mediating access to disk storage, and controlling network interfaces.

A complete operating system requires a userland: standard C libraries (glibc/musl), system shells (bash, zsh), core command utilities (coreutils: ls, cat, grep), compiler toolchains, and init systems. This software predominantly originated from the GNU Project founded by Richard Stallman in 1983, giving rise to the formal designation GNU/Linux.

Datacenter rack blades running enterprise Linux kernels
Figure 2: Enterprise server blades running headless Linux server distributions.

2. The Distribution Lineages

A distribution (distro) combines the Linux kernel with a curated suite of userland software, a default desktop environment or headless server configuration, and a package management ecosystem:

  • The Debian Family (Debian, Ubuntu, Linux Mint): Known for rock-solid stability, utilizing the .deb format and apt package manager.
  • The Red Hat Family (RHEL, Fedora, Rocky Linux): Enterprise standard, utilizing RPM packages, dnf, and SELinux mandatory access controls.
  • The Arch Family (Arch Linux, Manjaro): Rolling-release model, cutting-edge kernel packages, utilizing pacman and the Arch User Repository (AUR).
  • Alpine Linux: Ultra-minimal distribution based on musl libc and BusyBox, famous for tiny 5MB Docker container images.

3. The Filesystem Hierarchy Standard (FHS)

Unlike Windows with its partitioned drive letters (C:\, D:\), Linux organizes all physical drives, virtual devices, and pseudo-filesystems under a single unified tree starting at the root directory (/):

  • /etc — Host-specific system-wide configuration text files.
  • /var — Variable data: application logs (/var/log), databases, spool files.
  • /proc — Virtual pseudo-filesystem exposing real-time kernel data structures and process states.
  • /dev — Device nodes representing physical and virtual hardware interfaces (e.g., /dev/sda, /dev/urandom).
  • /home — Personal user directories, dotfiles, and documents.
Terminal shell prompt inspecting file permissions and ownership
Figure 3: Auditing POSIX file permissions, user groups, and inode metadata in bash.

4. The Linux Permissions Model

Every file and directory in Linux is owned by a User and a Group, and maintains three permission triplets: Read (r=4), Write (w=2), and Execute (x=1):

$ ls -l /var/www/index.html
-rw-r--r--  1 www-data www-data  4096 Oct 10 12:00 index.html
# User (www-data): rw- (6)
# Group (www-data): r-- (4)
# Others: r-- (4)
# Octal mode: 644

5. Process Management and UNIX Signals

Every executing program is a process identified by a unique Process ID (PID). Processes spawn child processes via the fork() and exec() system calls.

Processes communicate and terminate using asynchronous Signals:

  • SIGTERM (15): Polite termination request. The process catches this signal, completes database transactions, flushes buffers, and exits cleanly.
  • SIGKILL (9): Unconditional kernel-level termination. The kernel immediately destroys the process memory space without giving the process any opportunity to clean up.

6. Modern Service Control with `systemd`

The first process spawned by the Linux kernel is PID 1, universally managed in modern distributions by systemd:

# Managing system services:
$ sudo systemctl start nginx
$ sudo systemctl status nginx
$ sudo systemctl enable nginx    # Start automatically at boot

# Inspecting real-time binary system logs:
$ journalctl -u nginx -f
Motherboard architecture representing system bus and hardware interrupts
Figure 4: Hardware interrupts handled by the Linux kernel scheduler.

7. Streams, Pipes and the UNIX Philosophy

The foundational UNIX philosophy states: "Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams."

Every process possesses three standard file descriptors: Standard Input (stdin=0), Standard Output (stdout=1), and Standard Error (stderr=2).

# Chaining small utilities with pipes (|):
$ cat /var/log/nginx/access.log | grep "404" | awk '{print $7}' | sort | uniq -c | sort -nr | head -n 5

8. A 7-Day Pragmatic Linux Immersion Plan

  1. Day 1: Install Ubuntu or Fedora in a local virtual machine (VirtualBox, UTM, or WSL2).
  2. Day 2: Master navigation commands without touching the mouse (cd, ls, pwd, mkdir, rm).
  3. Day 3: Understand permissions (chmod, chown) and user management (sudo).
  4. Day 4: Practice text editing using Nano or Vim.
  5. Day 5: Manage processes (ps aux, top, kill) and systemd services.
  6. Day 6: Configure SSH keys and establish remote shell sessions.
  7. Day 7: Write an automated bash backup script utilizing tar, cron, and pipes.

9. Frequently Asked Questions

What is the difference between `sudo` and logging in as `root`?

Logging directly in as root gives every command permanent, unrestricted superuser privileges, making catastrophic typographical errors fatal. sudo (Superuser Do) allows an authorized user to execute specific administrative commands with temporary privilege escalation, logging every action to /var/log/auth.log for auditing.

Why does Linux treat "everything as a file"?

Treating storage drives, network sockets, serial ports, and kernel data structures as file descriptors allows developers to use the identical standard I/O API (open(), read(), write(), close()) across all system resources.