๐ง DevOps Roadmap 2025 โ Step 2: Mastering Linux for DevOps Engineers For Beginners & Experienced Learn Linux from scratch and become a DevOps pro!

๐ Introduction
This is Step 2 in our DevOps Roadmap 2025 series.
If you're learning DevOps, Linux is not optional โ itโs the foundation of everything: servers, cloud, containers, automation tools, and pipelines.
In this blog, youโll learn:
Why Linux is essential in DevOps
How to use Linux on Windows
Linux commands for real-world DevOps tasks
What is
apt
,yum
, and how Linux handles softwareInterview questions with answers
Practical Linux usage in Azure DevOps
Letโs begin.
๐ Why Linux is Crucial for DevOps
Hereโs why DevOps Engineers rely on Linux:
Most cloud servers use Linux (AWS EC2, Azure VMs, GCP)
CI/CD pipelines often run on Linux agents
Tools like Docker, Kubernetes, Jenkins, Terraform run best on Linux
Scripting and automation are more powerful with Bash
Linux is open-source, stable, and secure
๐ก 90% of cloud infrastructure runs on Linux.
๐ป What is Linux?
Linux is a free and open-source operating system that works like Unix. It powers servers, cloud systems, mobile phones, and supercomputers.
Key Linux Components:
Kernel โ The core engine that interacts with hardware
Shell โ Command-line interface to talk to the system
Filesystem โ Hierarchical directory structure starting from
/
๐งฑ Linux Distributions (Distros)
A Linux distribution is a version of Linux packaged with tools and settings.
Distro | Best For | Package Manager | Free/Paid |
Ubuntu | Beginners, DevOps, cloud | apt | Free |
Debian | Stability, scripting | apt | Free |
CentOS | Enterprises | yum | Free |
RHEL | Corporate use | yum | Paid |
Alpine | Docker containers | apk | Free |
๐ฆ What is a Package Manager in Linux?
Just like Windows uses .exe
files and Android uses .apk
, Linux uses packages to install software.
Package Managers are tools to manage, install, update, and remove software.
Popular Package Managers:
Package Manager | Used In | Example Command |
apt (Advanced Package Tool) | Ubuntu/Debian | sudo apt install nginx |
yum (Yellowdog Updater Modified) | CentOS/Red Hat | sudo yum install nginx |
apk | Alpine Linux | apk add nginx |
๐ These tools automatically fetch software from the internet, resolve dependencies, and install.
๐ช Can You Use Linux on Windows?
Yes! You donโt need to install Linux separately โ use it inside Windows.
โ Best Options:
Tool | Description |
WSL | Run full Linux (Ubuntu) inside Windows Terminal |
Git Bash | Lightweight Bash emulator |
VirtualBox | Install full Linux as a virtual machine |
๐ก Install Ubuntu via WSL on Windows using:
wsl --install
๐ฅ๏ธ What is #!/bin/bash
in Shell Scripts?
The first line in many Linux scripts is:
#!/bin/bash
Itโs called a shebang. It tells Linux which interpreter to use.
#!
โ Signals a script interpreter/bin/bash
โ Path to Bash shell
๐ How to find your shell path?
which bash
Example output:
/bin/bash
You can also use:
#!/usr/bin/env bash
This is more portable and works across systems.
๐ค Using Linux VM as Agent in Azure DevOps
Linux virtual machines can be used as build agents in Azure DevOps pipelines, providing a reliable and efficient environment for running DevOps tasks and automation.
๐ Important Linux Commands for DevOps
Letโs explore key Linux commands with explanations.
๐น File and Folder Commands
pwd # Show current directory
ls -lh # List with size and details
cd /var/log # Change directory
mkdir myproject # Create folder
touch file.txt # Create empty file
rm -rf temp/ # Delete folder recursively
๐น File Viewing & Editing
cat file.txt # Show file content
less file.txt # Scrollable view
head -n 5 file.txt # First 5 lines
tail -n 10 file.txt # Last 10 lines
๐น Sorting & Filtering
sort names.txt # Sort lines alphabetically
sort -n numbers.txt # Sort numerically
uniq sorted.txt # Remove duplicates
grep "error" logfile.txt # Find lines with "error"
wc -l file.txt # Count lines
๐น User & Group Management
sudo adduser devuser # Add user
sudo deluser devuser # Delete user
sudo groupadd devgroup # Add group
sudo usermod -aG devgroup devuser # Add user to group
๐ Understanding chmod 777
โ File Permissions in Linux
When you run this command:
chmod 777 filename
You're setting the permissions of the file to 777
. But what does that mean? Letโs break it down step by step.
๐ Linux File Permission Basics
Linux assigns three types of permissions to each file or directory:
Permission | Symbol | Meaning |
Read | r | Can read/view file |
Write | w | Can edit or delete |
Execute | x | Can run as a program or script |
And these are assigned to three types of users:
Owner (User who owns the file)
Group (Users in the same group)
Others (Everyone else)
๐ง What Does 777
Mean?
Each permission is assigned a numeric value:
Read (
r
) = 4Write (
w
) = 2Execute (
x
) = 1
To set permissions, we add the numbers:
7
=4 + 2 + 1
โ read + write + executeSo
777
means:Owner:
7
โ read, write, executeGroup:
7
โ read, write, executeOthers:
7
โ read, write, execute
This means everyone has full access to the file or directory โ they can read, modify, and run it.
๐น System Monitoring
top # Live CPU/memory usage
df -h # Disk usage
free -m # Memory in MB
uptime # System running time
๐น Networking Commands
ip a # Show IP addresses
ping google.com # Test network connectivity
curl ifconfig.me # Show public IP address
๐น File Creation Techniques (Interview Tip)
How many ways to create a file?
touch file.txt
echo "data" > file.txt
cat > file.txt
vi file.txt
nano file.txt
๐ Interview Questions
๐ก For Freshers
Q1. What is Linux?
A free and open-source operating system used for servers and cloud.
Q2. Whatโs the difference between apt
and yum
?
apt
โ Ubuntu/Debianyum
โ CentOS/Red Hat
Both are used to install software.
Q3. How do you create a new user in Linux?
sudo adduser newuser
Q4. Why do we add #!/bin/bash
in scripts?
It tells the OS to use Bash to run the script.
๐ก For Experienced Engineers
Q1. How do you use a Linux VM as an agent in Azure DevOps?
Linux VMs can serve as self-hosted agents to run your pipelines and automation efficiently.
Q2. Whatโs the difference between chmod 755
and 777
?
755
: Owner can read/write/execute; others read/execute777
: Everyone can read/write/execute (insecure)
Q3. What is the difference between sort
, uniq
, and grep
?
sort
โ Arranges linesuniq
โ Removes duplicate linesgrep
โ Filters lines based on keywords
Q4. How to monitor disk usage sorted by size?
du -sh * | sort -h
๐ Summary
Youโve now mastered:
โ
Linux basics
โ
What are apt
and yum
package managers
โ
Using Linux with Windows
โ
File, system, network, user commands
โ
#!/bin/bash
and why it matters
โ
Using Linux VMs as Azure DevOps agents
โ
Real-world interview Q&A
๐ Next in the DevOps Roadmap
โก๏ธ Step 3: Mastering Terraform โ Infrastructure as Code
๐ฌ Loved this blog?
๐ Like & share with fellow DevOps learners
๐ Post on LinkedIn, Dev.to, or Hashnode
๐ฃ๏ธ Comment your doubts or questions below
Subscribe to my newsletter
Read articles from Harshal Sonar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
