"DevOps without Linux is like a car without wheels." Before you touch Kubernetes, Docker, Jenkins, or Terraform, your first step is mastering the core foundation - Linux. It's the OS that powers cloud servers, containers, CI/CD pipelines, and production infrastructure.
In this expert guide, I'll walk you through everything you MUST know in Linux before jumping into DevOps tools. We'll also include cheat sheet commands, real-life examples, extra notes, and curated learning links to make you a Linux ninja. 💻⚡
🔗 Table of Contents
Why Linux is Critical for DevOps
Core Linux Topics to Master
1.Process Management
2.Networking
File System Structure
Permissions & Ownership
Disk & Storage Management
File Search & Text Processing
Package Management
System Configuration
Monitoring & Logging
Service Management
SSH Configuration
Shell Scripting
System Information
3.Linux Cheat Sheet for DevOps
4.Recommended Learning Resources
- Final Pro Tips & Summary ✅ Why Linux is Critical for DevOps 95%+ of cloud servers run on Linux (AWS EC2, GCP Compute Engine, Azure VM). DevOps tools like Docker, Kubernetes, Jenkins, Ansible, and Terraform use Linux-based commands. You'll troubleshoot issues using logs, shell, and systemctl inside Linux servers. Shell scripting automates DevOps pipelines and server management.
🔧 Core Linux Topics to Master
Let's break down the must-learn areas, with commands, use cases, and advanced tips.
**🔺 1. Process Management
**Commands to Know:
ps aux
top
htop
kill -9 <PID>
nice, renice
pstree
Use Cases:
Monitor running applications (CPU/memory hogs)
Kill stuck processes
Analyze service hierarchy (e.g., Apache forked processes)
Pro Tip: Use htop for interactive real-time process monitoring. It's more visual than top.
**🌐 2. Networking
**Commands to Know:
ip a # Show interfaces
ping 8.8.8.8 # Test connectivity
traceroute <IP>
netstat -tulnp
ss -ltn
dig example.com
iptables -L
ufw status
Use Cases:
Check if server is reachable or port is open
Diagnose DNS or firewall issues
Configure network interfaces
Extra Notes:
ss is faster and more modern than netstat
Use iptables or ufw for basic firewall setup
**
📂 3. File System Structure**
Commands to Know:
cd, ls, pwd
mkdir, rmdir
cp, mv, rm
touch, stat
tree
Key Directories:
/etc – config files
/var/log – logs
/home – user directories
/tmp – temporary files
/opt – optional packages
Pro Tip: Use tree to view folder structure hierarchically.
**🔐 4. File Permissions & Ownership
**Commands to Know:
chmod 755 file
chown user:group file
chgrp group file
ls -l
umask
Permission Notation:
Symbolic: rwxr-xr--
Numeric: 755, 644, 700
Use Cases:
Secure files from unauthorized access
Set executable scripts
Assign file access to groups
**💽 5. Disk & Storage Management
**Commands to Know:
df -h # Disk space
du -sh * # Directory size
mount, umount
lsblk
fdisk -l
Use Cases:
Monitor disk usage
Clean up storage
Mount volumes
**🔍 6. File Search & Text Processing
**Commands to Know:
find / -name "*.log"
grep -i "error" file.log
cut -d':' -f1 /etc/passwd
awk '{print $1}' file.txt
sort, uniq, wc
sed 's/error/ERROR/g'
Use Cases:
Filter logs and extract data
Automate text changes
Analyze config/data files
Pro Tip: Combine tools in pipelines like:
cat file.txt | grep "404" | awk '{print $7}' | sort | uniq -c
**📦 7. Package Management
**Debian-based (Ubuntu):
apt update && apt upgrade
apt install nginx
apt remove apache2
dpkg -l
RHEL-based (CentOS, Fedora):
yum install nginx
dnf update
rpm -qa
Use Cases:
Install software on cloud servers
Manage updates and security patches
**⚙️ 8. System Configuration
**Files & Concepts:
~/.bashrc, ~/.profile
/etc/environment
Creating aliases (alias gs='git status')
Shell variables: export PATH=$PATH:/custom/path
**Use Cases:
**Customize shell experience
Set environment variables for tools
Automate common commands
**📊 9. Monitoring & Logging
**Commands to Know:
uptime
free -m
vmstat 1 5
sar -u 1 3
iostat
swapon --show
dmesg | tail
journalctl -xe
Use Cases:
Check system health during load spikes
Investigate memory/swap issues
Read system logs
**🔁 10. Service Management
**systemd (Modern):
systemctl status nginx
systemctl start nginx
systemctl enable nginx
Legacy (SysVinit):
service nginx start
chkconfig --list
Use Cases:
Manage services on boot
Restart daemons during config changes
**🔐 11. SSH Configuration
**Commands & Files:
ssh user@ip
ssh-keygen -t rsa
ssh-copy-id user@ip
vi /etc/ssh/sshd_config
Use Cases:
Login securely to remote Linux servers
Set up passwordless authentication
Harden SSH (e.g., disable root login)
**🐚 12. Basic Shell Scripting
**Concepts:
Variables
Conditionals (if, elif)
Loops (for, while)
Functions
Reading input, writing output
Example:
#!/bin/bash
echo "Enter name:"
read name
echo "Hello, $name"
Use Cases:
Automate deployments
Write custom monitoring scripts
**🖥️ 13. System Information
**Commands to Know:
uname -a
hostnamectl
lsb_release -a
cat /etc/os-release
Use Cases:
Identify OS and kernel version
Debug platform-specific issues
Match packages to distributions
**🧾 Linux Cheat Sheet for DevOps
**Task & Commands
- View running processes -- ps aux, htop
- Check IP address -- ip a, hostname -I
- Test internet connectivity -- ping 8.8.8.8, traceroute google.com
- Find files -- find / -name "filename"
- Search inside files -- grep -i "text" filename
- Install package (Ubuntu) -- sudo apt install package-name
- View disk usage -- df -h, du -sh
- Start/Stop services --
systemctl start stop status service-name
- View logs -- journalctl -xe, cat /var/log/syslog
- Add user - useradd -m username, passwd username
📚 Recommended Learning Resources
🌐 Websites
Linux Journey
The Linux Command Line Book (Free PDF)
Explainshell
SS64
**📺 YouTube Channels
**NetworkChuck - Linux Basics
The Net Ninja - Linux Tutorials
**📘 Books
**The Linux Command Line by William Shotts
UNIX and Linux System Administration Handbook
**💡 Final Pro Tips & Summary
**Don't try to memorize commands - build projects, automate tasks, and break things to learn deeply.
Use tmux or screen to persist terminal sessions during server management.
Learn cron jobs and log rotation for production-level scheduling and stability.
Master man command: it's your best friend. Example:
man systemctl
🚀 Ready for DevOps?
Once you've mastered Linux, the transition to tools like Docker, Ansible, Jenkins, and Kubernetes becomes 10x easier. You'll be configuring containers, setting up servers, and troubleshooting issues like a pro.
🛠 Start with daily practice: ✅ Use a cloud VM (like AWS Free Tier Ubuntu) ✅ Join DevOps Discord or Reddit groups ✅ Automate small tasks using bash
💬 Want a custom Linux learning roadmap with hands-on labs? Drop a message, and I'll create one for you, bro.
Let's level up your DevOps career - one command at a time. 💪🐧
📢 Your Turn: Which Linux command do you use the most as a DevOps engineer? 👇 Comment below and let's share the toolbox!
Top comments (0)