Galle, LK--:--5/6 sites live

Linux Fundamentals for DevOps Engineers

Linux is the bedrock of modern DevOps, cloud infrastructure, containerization (Docker, Kubernetes), and server administration. Every container runs a Linux userland; every cloud VM boots Linux by default.

1 Jun 20263 min readSelf Guide · Stage 1#Linux#Bash#W3DevOps

Lesson 1 of 26 · Module: Linux

12 min read · Source notes — 70 Linux Commands You Need to Know

Linux is the bedrock of modern DevOps, cloud infrastructure, containerization (Docker, Kubernetes), and server administration. Every container runs a Linux userland; every cloud VM boots Linux by default.

The Linux Architecture: Kernel vs Shell

Output
Hardware (CPU, RAM, Disks, Network Interfaces)
   ↓
Linux Kernel (Process Scheduler, Memory Manager, Virtual File System, Network Stack)
   ↓
Shell & Utilities (Bash, Zsh, Systemd, Coreutils, Package Managers)
   ↓
User Applications & Containers (Docker, Nginx, Node.js, Python, PostgreSQL)

Why Linux over Windows/macOS for Servers?

  • Headless & Lightweight: Runs without a graphical user interface (GUI), consuming as little as 100MB of RAM.
  • Everything is a File: Hardware devices, running processes, sockets, and configuration files are represented as files in the virtual filesystem.
  • Scriptable & Automatable: CLI-first design allows full automation via Bash, Python, and CI/CD pipelines.
  • Container Native: Modern containers leverage Linux kernel primitives: Namespaces (isolation) and cgroups (resource limits).

Linux Filesystem Hierarchy Standard (FHS)

Unlike Windows (which uses drive letters like C:\), Linux uses a single unified tree starting at the root directory /.

DirectoryFull NameDevOps Purpose
/RootTop-level directory that contains all other directories and mounted filesystems.
/etcEditable Text ConfigurationsHost-specific system-wide configuration files (e.g., /etc/nginx/, /etc/hosts).
/varVariable DataFiles that change constantly during runtime, such as logs (/var/log/) and web roots (/var/www/).
/bin & /usr/binBinariesEssential executable command binaries for all users (e.g., ls, cat, docker, curl).
/homeUser HomePersonal storage directories for standard users (e.g., /home/ubuntu/, /home/ec2-user/).
/procProcess InformationPseudo-filesystem containing runtime system & kernel metrics (e.g., /proc/cpuinfo, /proc/meminfo).

Terminal Overview

Instructor introducing the terminal environment and core workflow for essential Linux administration.

Standard Streams & Redirection

Every Linux process starts with three default input/output streams:

  • 0 (stdin): Standard Input (keyboard by default)
  • 1 (stdout): Standard Output (terminal display)
  • 2 (stderr): Standard Error (terminal display for errors)

Example: Redirecting stdout and stderr in DevOps

ExampleShell
# Redirect stdout to a file (overwrite)
echo "Deploying version 2.4.0" > deploy.log

# Append stdout to a file
echo "Migration completed successfully" >> deploy.log

# Redirect stderr to an error log
./run_app.sh 2> errors.log

# Redirect BOTH stdout and stderr to the same file (industry standard for cron/systemd)
./start_worker.sh > output.log 2>&1
# Or in modern Bash:
./start_worker.sh &> output.log

Keep going: ← Course overview · Lesson 2 → · Module overview · Track it in the Self Guide