Linux Operating System – Complete DevOps Study Notes

Published: (January 6, 2026 at 01:50 PM EST)
4 min read
Source: Dev.to

Source: Dev.to

Part 1 – Linux Fundamentals & Architecture

1. What is Linux?

Linux is an open‑source, Unix‑like operating‑system kernel. In a DevOps context “Linux” usually refers to a distribution (e.g., Ubuntu, CentOS, Alpine) that bundles the kernel, system utilities, and a package manager.

ComponentDescription
KernelCore that manages CPU, memory, and I/O
ShellCLI interface to the kernel (e.g., Bash, Zsh)
UserspaceWhere applications run

2. Linux File‑System Hierarchy

Linux uses a single hierarchical tree that starts at the root /.

/
├─ bin & /usr/bin      – Essential user binaries (ls, cp, …)
├─ etc                – Configuration files (e.g., /etc/nginx/nginx.conf)
├─ home               – User home directories (e.g., /home/john)
├─ var                – Variable data (logs, spool files, temporary e‑mail)
├─ tmp                – Temporary files (cleared on reboot)
└─ proc               – Virtual FS exposing process & kernel info

Part 2 – Essential File Management & Permissions

1. File‑Management Commands

CategoryCommands
Navigationpwd – print working directory
cd – change directory
ls -la – list all files with details
Manipulationtouch file – create empty file
mkdir -p dir/subdir – create directory (parents if needed)
cp -r source dest – copy recursively
mv source dest – move/rename
rm -rf path – force‑remove (use with caution)
Viewingcat file
less file
head file
tail file

2. File Permissions

Permissions are split into User (u), Group (g), and Others (o).

SymbolValue
r (read)4
w (write)2
x (execute)1

Common commands

chmod 755 file          # u=rwx (7), g=rx (5), o=rx (5)
chmod +x script.sh      # add execute bit
chown user:group file   # change owner & group
chgrp group file        # change group only

Part 3 – User, Group, & Package Management

1. User & Group Management

FilePurpose
/etc/passwdUser account information
/etc/shadowSecure password hashes
/etc/groupGroup definitions

Typical commands

# Create a user with a home directory and Bash shell
useradd -m -s /bin/bash username

# Add user to the sudo group
usermod -aG sudo username

# Set (or change) password
passwd username

# Show UID/GID information
id username

2. Package Management

Distro FamilyPackage ManagerInstall CommandUpdate / Upgrade Command
Debian / Ubuntuaptapt install <package>apt update && apt upgrade
RHEL / CentOSyum / dnfyum install <package>yum update
Alpineapkapk add <package>apk update

Part 4 – Networking & Firewall

1. Network Configuration & Troubleshooting

CommandDescription
ip addr showShow IP addresses (modern replacement for ifconfig)
ip routeDisplay routing table
ping <host>Test connectivity
curl -I <url>Show HTTP headers
wget <url>Download files
nslookup <domain> / dig <domain>DNS lookup
netstat -tulpn or ss -tulpnList listening ports (useful for debugging services)

2. Linux Firewalls

FirewallTypical Usage
UFW (Ubuntu)Simple wrapper around iptables
firewalld (CentOS/RHEL)Dynamic firewall manager
iptablesLegacy, low‑level packet filter

Examples

# UFW
ufw allow 22/tcp          # allow SSH
ufw enable                # enable firewall

# firewalld
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

# iptables (basic example)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

Part 5 – Processes, Systemd, & Boot

1. The Boot Process

  1. BIOS/UEFI – hardware POST, loads bootloader.
  2. Bootloader (GRUB) – loads the kernel image.
  3. Kernel – mounts the root filesystem, starts init.
  4. init (systemd) – PID 1, launches user‑space services.

2. Systemd (Service Management)

systemctl start nginx          # start now
systemctl enable nginx         # start on boot
systemctl status nginx         # view status
journalctl -u nginx            # view service‑specific logs

3. Monitoring & Troubleshooting

ToolPurpose
top / htopReal‑time CPU & memory
df -hDisk space usage
du -sh /pathSize of a specific directory
free -mMemory summary
ps aux | grep <process>Find processes
kill -9 <pid>Force‑kill a process

Part 6 – Shell Scripting (Bash)

Automation is the heart of DevOps.

#!/bin/bash
# -------------------------------------------------
# Example Bash script
# -------------------------------------------------

# Variables
NAME="DevOps Engineer"
DIR="/var/www/html"

# Conditionals
if [ -d "$DIR" ]; then
    echo "Directory exists."
else
    mkdir -p "$DIR"
    echo "Directory created."
fi

# Loops
for i in {1..5}; do
    echo "Iteration $i"
done

Key concepts

ConceptExplanation
Exit status$?0 = success, non‑zero = error
Arguments$1, $2, … – positional parameters
Redirection> overwrite, >> append, `

Part 7 – SSH Configuration & Security

FilePurpose
/etc/ssh/sshd_configSSH daemon configuration

Security Best Practices (Hardening)

  1. Disable root login – set PermitRootLogin no.
  2. Disable password authentication – set PasswordAuthentication no.
  3. Change the default port (optional) – e.g., Port 2022.

Key‑Based Authentication

# On the client
ssh-keygen -t rsa -b 4096          # generate key pair
ssh-copy-id user@remote-server    # copy public key to server

# On the server (verify permissions)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Part 8 – Advanced Concepts & Cloud

1. Web‑Server Administration

ServerTypical UseMain Config Location
NginxReverse proxy / load balancer/etc/nginx/sites-available/ (linked from sites-enabled)
ApacheTraditional web server/etc/httpd/conf/httpd.conf (RHEL) or /etc/apache2/apache2.conf (Debian)

Logs are usually found under /var/log/nginx/ or /var/log/httpd/.

2. Reading Access Logs

  • File: /var/log/nginx/access.log
  • Purpose: Debug 404/500 errors.

3. Linux in the Cloud (AWS / Azure / GCP)

  • Cloud‑Init – runs once when a cloud instance boots to install packages and write files.
  • Ephemeral Storage – some cloud disks disappear on termination; be aware of their transient nature.
  • Metadata Services – query http://169.254.169.254 from within the VM to retrieve instance information (IP, region, etc.).

4. Text Processing (The “Swiss Army Knives”)

DevOps engineers frequently parse logs using these tools:

  • grep – Search for text

    grep "error" file.log
  • awk – Print specific columns

    awk '{print $1}' file.txt
  • sed – Find and replace text

    sed 's/old/new/g' file.txt

Checkout this for advanced study on Linux for DevOps.

Back to Blog

Related posts

Read more »

Code And Let Live

The state of the art in agent isolation is a read-only sandbox. At Fly.io, we’ve been selling that story for years, and we’re calling it: ephemeral sandboxes ar...

Friday Five — January 9, 2026

Announcement Red Hat and NVIDIA have expanded their collaboration to launch Red Hat Enterprise Linux for NVIDIA, a specialized platform designed to provide Day...