Every computer is just raw hardware — a CPU that does calculations, RAM that holds data temporarily, a disk that stores things permanently, and a network card that sends and receives data. That hardware alone does absolutely nothing useful. It needs software to coordinate it all. The **Operating System** is that software. It sits between you and the hardware, acting as the translator. When you type a command, the OS figures out which piece of hardware needs to do what, tells it to do it, and gives you the result back. Without an OS, you could not run a single application — not even a calculator. Think of it like a large hospital. The equipment (hardware) — MRI machines, beds, operating rooms — is all there. But without doctors, nurses, and administrators (the OS) coordinating everything, none of it gets used effectively. The OS is the entire coordination layer. Windows, macOS, and Linux are all operating systems. They all solve the same fundamental problem — making hardware usable — but they make very different design choices about security, performance, cost, and control. ### What an OS actually does The OS has six core responsibilities. Understanding these helps you understand why Linux behaves the way it does — especially when something goes wrong. You type a command or click something ↓ Operating System (coordination layer) ↓ +--------+---------+--------+---------+ | | | | | CPU RAM Disk Network Devices (run) (store) (save) (connect) (keyboard/mouse) * **Process Management** — every running program is a "process." The OS decides which process gets CPU time, for how long, and in what order. On a server running 200 processes simultaneously, the OS is constantly juggling — giving each one a few milliseconds of CPU time in rotation, so fast it feels like everything runs at once. * **Memory Management** — each process needs RAM to work. The OS gives each process its own isolated memory space and strictly prevents one process from reading or writing another's memory. This is why one crashed app does not bring down other apps — they live in separate memory bubbles. * **File System** — organises how data is stored and retrieved from disk. Without a file system, a disk is just billions of raw bytes with no structure. The OS (through the file system) gives you folders, filenames, permissions, and the ability to find your data again. * **Device Management** — your keyboard, mouse, network card, and GPU all speak different hardware languages. The OS talks to each through **device drivers** — small translator programs. You plug in a USB device and the OS loads the right driver automatically. * **Security** — controls who can access what through users, groups, and permissions. On a Linux server, the user who owns the web server process can read web files but cannot read system configuration. This isolation limits damage if anything is compromised. * **Networking** — manages the network stack (TCP/IP), handles socket connections, and controls which processes can listen on which ports. ### Types of Operating Systems | Type | Examples | Where You See It | |---|---|---| | Desktop OS | Windows 11, macOS | Personal computers, laptops | | Server OS | Linux (Ubuntu, CentOS, RHEL) | Web servers, cloud, DevOps | | Mobile OS | Android, iOS | Phones, tablets | | Embedded OS | RTOS, VxWorks | Routers, cars, IoT devices | | Real-Time OS | FreeRTOS, QNX | Systems needing microsecond precision | In DevOps, you live in **Server OS territory**. Almost every server on the planet runs Linux, and almost every tool in the DevOps ecosystem — Docker, Kubernetes, Terraform, Ansible — was built to run on Linux first. ---
**Linux** is a free, open-source operating system kernel created by **Linus Torvalds in 1991**. He was a Finnish university student frustrated that good operating systems were expensive. So he built one from scratch and gave it away. Today Linux powers everything: * 96% of the world's web servers * Every Android phone (Android is built on the Linux kernel) * Every Docker container * Every Kubernetes node * AWS, GCP, and Azure servers by default * The International Space Station * Tesla cars * Most supercomputers on earth When you become a DevOps engineer, you will spend most of your working day inside a Linux terminal. There is no path around it. ### Unix vs Linux — the lineage **Unix** was created at Bell Labs (AT&T) in the 1970s. It was revolutionary — stable, multi-user, powerful. But it was proprietary and expensive. Companies had to pay large licensing fees. **Linux** arrived in 1991 as a free, from-scratch reimplementation of the same ideas. It follows Unix philosophy but contains none of the original Unix code. This is why Linux is called "Unix-like." **macOS** is also Unix-based (its core is called Darwin). This is why terminal commands on Mac and Linux are nearly identical — they share Unix DNA. The Unix/Linux philosophy you will feel everywhere: * **Everything is a file** — your disk, your keyboard, your network card — Linux treats them all as files in `/dev/` * **Small tools that do one thing well** — `ls` just lists files, `grep` just searches text, combine them to do powerful things * **The terminal is king** — everything can be done without any graphical interface ### Linux vs Windows — why servers use Linux | Feature | Linux | Windows Server | |---|---|---| | Cost | Free | Expensive license | | Source code | Public, auditable | Closed | | Server uptime | Years without reboot | Regular reboots | | CLI power | Extremely powerful | Limited (PowerShell helps) | | Security model | Strong user separation | Less granular | | Package management | apt / yum / pacman | No native standard | | DevOps tooling | Native | Mostly ported | For a company running 1000 servers, the licensing difference alone saves millions per year. ### Where Linux fits in the DevOps stack Your laptop terminal (you type commands here) ↓ SSH connection (encrypted tunnel to a remote server) ↓ Linux Server on AWS / GCP / Azure (your app lives here) ↓ Docker containers (mini Linux environments inside your server) ↓ Kubernetes nodes (Linux VMs managing your containers) ↓ CI/CD runners (Linux machines running your automated pipelines) Every single layer is Linux. Learning Linux does not unlock one tool. It unlocks the entire stack. ---
When people say "Linux," they technically mean the **kernel** — the single most important piece of software in the entire system. Everything else (the shell, the package manager, the desktop environment) is built on top of it. The kernel is the very first thing that loads when Linux boots, and it stays running in memory the entire time the system is on. It never stops. You never interact with it directly — it works silently underneath every single thing you do. When you run `ls`, your shell asks the kernel to read directory entries. When nginx serves a web request, it asks the kernel to open a network socket. Every action goes through the kernel. Your shell and applications ↓ System Calls (the kernel's door) ↓ KERNEL <-- always running, never visible directly ↓ +---------+---------+---------+---------+ | | | | | CPU RAM Disk Network Devices ### What the kernel does * **Process Management** — creates a new process when you run a command, schedules which process runs on which CPU core and for how long, and cleans up when a process exits. On a busy server this scheduling happens thousands of times per second. * **Memory Management** — when an app needs RAM, it asks the kernel. The kernel allocates it, tracks which process owns which memory pages, and swaps memory to disk if RAM runs out. Critically, it enforces isolation — process A cannot read process B's memory, even if they run as the same user. * **Device Drivers** — hardware speaks binary protocols that nothing else understands. Drivers are translation layers the kernel uses to talk to specific hardware. A network driver knows how to send packets to a network card. A disk driver knows how to read sectors from an SSD. The kernel loads the right driver automatically. * **File System** — the kernel handles all file operations. When you `cat` a file, the kernel reads the raw blocks from disk and gives you the bytes. When you `echo "hello" > file.txt`, the kernel writes the bytes to disk. The kernel supports dozens of file system formats — ext4, XFS, NTFS, FAT32 — switching between them transparently. * **System Calls** — applications do not talk to hardware directly. They make **system calls** — requests to the kernel for services. `open()` asks the kernel to open a file. `write()` asks it to write data. `fork()` asks it to create a new process. This is why a program compiled on Linux works on any Linux system — the system call interface is stable and consistent. * **Networking** — the kernel contains a full TCP/IP networking stack. It manages network interfaces, handles incoming and outgoing packets, and exposes sockets that applications use to send and receive data over the network. ### Kernel types — for interviews | Type | How it works | Used in | Speed | |---|---|---|---| | Monolithic | All services in one kernel space — fast but if one part crashes, everything does | Linux, Unix | Very fast | | Microkernel | Only absolute bare essentials in kernel, everything else in user space — safer but slower | Minix, QNX | Slower | | Hybrid | Combines both — some services in kernel, some outside | Windows NT, macOS XNU | Balanced | Linux uses a **Monolithic kernel** — the scheduler, memory manager, device drivers, and file system are all compiled into one piece of code running in one protected memory space. This eliminates the overhead of constantly switching between kernel space and user space, which is why Linux servers can handle enormous workloads efficiently. > 💡 **Tip:** You can check which kernel version your server is running with `uname -r`. Kernel version matters when troubleshooting — some features and driver support only exist in newer kernels. ---
The Linux **kernel** alone is not a usable operating system. The kernel manages hardware beautifully, but it cannot do much for you by itself — you need a shell to type commands, a package manager to install software, system libraries that programs depend on, and a set of default tools. A **Linux distribution (distro)** bundles all of this together into a complete, installable operating system. Think of the kernel as a powerful car engine sitting on the factory floor. A distribution is the finished car built around that engine — different manufacturers (Canonical, Red Hat, the Debian community) design different cars with different dashboards and features, but every single one uses that same Linux engine underneath. This is why a bash command you learn on Ubuntu works identically on CentOS, Alpine, and Amazon Linux — the kernel and core tools are shared. Linux Kernel (the engine — same for all) | +---------+---------+---------+---------+ | | | | | Ubuntu Debian CentOS Alpine Amazon Linux (Canonical)(comm.) (Red Hat)(Alpine) (AWS) apt pkg apt pkg yum pkg apk pkg yum pkg Desktop Server Enterprise Containers Cloud ### Major distributions you will encounter in DevOps | Distro | Package Manager | Release Model | Best Used For | |---|---|---|---| | **Ubuntu 22.04 LTS** | `apt` | LTS every 2 years, supported 5 years | Learning, cloud servers, most beginner-friendly | | **Debian** | `apt` | Stable releases, extremely conservative | Rock-solid production servers, Docker base images | | **CentOS / Rocky Linux** | `yum` / `dnf` | RHEL-compatible | Enterprise environments, legacy production systems | | **Red Hat Enterprise Linux (RHEL)** | `dnf` | Paid subscription | Corporate enterprises with support contracts | | **Alpine Linux** | `apk` | Rolling | Docker containers — only 5MB, incredibly small | | **Amazon Linux 2023** | `dnf` | AWS-maintained | Default on AWS EC2, highly optimised for AWS | | **Fedora** | `dnf` | 6-month releases | Developers wanting cutting-edge packages | ### What LTS means and why it matters **LTS** stands for Long-Term Support. Ubuntu 22.04 LTS is supported with security patches until 2027. For a production server, this means you can install it and receive security updates for years without having to upgrade the entire OS. Non-LTS releases only get support for 9 months — too short for production systems that need to stay stable. ### Why Alpine is everywhere in containers Alpine Linux is built for one purpose: being as small as possible. A full Alpine installation is about 5MB. Compare that to Ubuntu at ~200MB. In Docker, where you might run thousands of container instances, that size difference compounds massively. It also means a smaller attack surface — fewer packages installed means fewer potential vulnerabilities. > 💡 **Tip:** Start with Ubuntu 22.04 LTS for learning and cloud servers. It has the largest community, the most Stack Overflow answers, and is used widely across AWS, GCP, and Azure. Everything you learn on Ubuntu transfers directly to other distros — commands are 95% identical. ---
**Virtualization** lets one physical machine pretend to be many separate computers. Each "pretend computer" is called a **Virtual Machine (VM)**. They share the physical hardware but are completely isolated from each other. This is how AWS, GCP, and Azure work. When you launch an EC2 instance, you are getting a VM running on a massive physical server in a data center. Physical Hardware (CPU, RAM, Disk, Network) | Hypervisor software | +------------+------------+ | | | VM 1 VM 2 VM 3 Ubuntu 22.04 CentOS 8 Windows Web Server Database Test Env Each VM has its own virtual CPU, virtual RAM, virtual disk, and its own OS. They are completely isolated — if VM 2 crashes, VM 1 and VM 3 keep running perfectly. ### Type 1 vs Type 2 hypervisors **Type 1 — Bare Metal** — runs directly on the physical hardware. No host OS needed. This is what data centers and cloud providers use. Maximum efficiency. Applications (inside VM) ↓ Guest OS (Ubuntu, etc.) ↓ Type-1 Hypervisor <-- runs directly on hardware ↓ Physical Hardware Examples: VMware ESXi, Microsoft Hyper-V, KVM (built into Linux) **Type 2 — Hosted** — runs as an application on top of an existing OS. Easier to set up. Used for local development and learning. Applications (inside VM) ↓ Guest OS (Ubuntu, etc.) ↓ Type-2 Hypervisor <-- runs as a program ↓ Host OS (your Windows or Mac) ↓ Physical Hardware Examples: VirtualBox, VMware Workstation, Parallels Desktop For learning Linux: **VirtualBox** is free, works on Windows and Mac, and is perfect for practice. ---
Before practising anything, you need a Linux machine to work on. There are three good ways depending on your situation. ### Option 1 — VirtualBox (best for complete beginners) VirtualBox lets you run a full Linux computer inside your existing Windows or Mac computer. You can break things, experiment freely, and just reset if something goes wrong — without touching your real machine. ```bash // After installing VirtualBox and downloading Ubuntu ISO: // 1. Open VirtualBox → New // 2. Name: Ubuntu | Type: Linux | Version: Ubuntu (64-bit) // 3. RAM: 2048 MB minimum (4096 MB recommended) // 4. Create Virtual Hard Disk → 20 GB minimum // 5. Start the VM → select your Ubuntu ISO → follow the installer ``` Download: `https://www.virtualbox.org` and `https://ubuntu.com/download/server` ### Option 2 — WSL2 (Windows users, quickest setup) WSL2 (Windows Subsystem for Linux) runs Ubuntu directly inside Windows — no VM needed. ```powershell // Open PowerShell as Administrator: wsl --install // Restart your PC, then open "Ubuntu" from the Start Menu // Create a username and password when prompted // You now have a full Linux terminal inside Windows ``` ### Option 3 — Cloud VM (most realistic for DevOps) This is how real DevOps engineers work. AWS gives you a free t2.micro server for 12 months on their Free Tier. ```bash // 1. Create free AWS account at aws.amazon.com // 2. Go to EC2 → Launch Instance // 3. Choose Ubuntu 22.04 LTS // 4. Select t2.micro (Free Tier eligible) // 5. Create a key pair → download the .pem file // 6. Launch → get the public IP address // 7. Connect from your terminal: ssh -i my-key.pem ubuntu@<YOUR-EC2-IP> ``` > ⚠️ **Security:** Always do `chmod 400 my-key.pem` before SSH. AWS will reject the key if permissions are too open. ### Reading the terminal prompt When you open a Linux terminal you see something like this: daksh@webserver-prod:~/projects$ | | | | | | | +-- $ = regular user (# = root/admin) | | +---------- ~ = current directory (~ means home) | +----------------------- hostname (which server you are on) +-------------------------------- your username Reading the prompt tells you instantly: who you are, which server you are on, and where in the filesystem you are. This matters when you have SSH sessions open to multiple servers at once. ---
Every computer is just raw hardware — a CPU that does calculations, RAM that holds data temporarily, a disk that stores ...
Linux is a free, open-source operating system kernel created by Linus Torvalds in 1991. He was a Finnish university stud...
When people say "Linux," they technically mean the kernel — the single most important piece of software in the entire sy...
The Linux kernel alone is not a usable operating system. The kernel manages hardware beautifully, but it cannot do much ...
Virtualization lets one physical machine pretend to be many separate computers. Each "pretend computer" is called a Virt...
Before practising anything, you need a Linux machine to work on. There are three good ways depending on your situation. ...
On Windows, files live under drive letters: C:\, D:\. Linux works completely differently. There is one single unified tr...
These are the commands you will type hundreds of times every week. They need to become automatic. pwd, ls, cd — the thre...
This is where you spend a significant portion of your time on any Linux server. Creating project structures, copying con...
Permissions are one of the most important concepts in Linux. Every "permission denied" error, every 403 Forbidden from n...
Think about what a DevOps engineer actually does every day: search through thousands of log lines to find one specific e...
Linux is a multi-user system by design. Multiple people can be logged in simultaneously, and multiple services can run u...
A process is any running program. When you run ls, a process starts, prints output, and exits in milliseconds. When you ...
A full disk is one of the most common causes of production outages. When disk fills up, the application cannot write log...
Environment variables are named values that exist in your shell session and can be read by any program you launch from t...
vi is installed on every single Linux system — including the most minimal Docker container and broken servers in recover...
This is how you install, update, and remove software on Linux — like an app store from the terminal. Ubuntu / Debian — a...
Checking your network DNS — how names become IPs SSH — connecting to remote servers SSH keys — the professional way Pass...
Cron runs commands automatically at specified times. Backups at 2am, weekly reports, log cleanup — all done without anyo...
A shell script is a text file containing a sequence of shell commands that runs automatically from top to bottom. Instea...
Understanding your storage Adding and using a new disk LVM — expand storage without downtime Without LVM, resizing a dis...
Understanding the boot process helps you fix servers that will not start and understand how services initialise. POWER O...
Navigation and files Command What it does Example pwd Where am I? pwd ls -lah List all with sizes ls -lah /etc cd /path ...
Aligns directly with DevOps, Site Reliability (SRE), and Platform Engineering job descriptions.