DEV Community

Cover image for Day 2 — Linux Fundamentals
Rahul Joshi
Rahul Joshi

Posted on

Day 2 — Linux Fundamentals

🐧 Linux Fundamentals Every DevSecOps & Cloud Engineer Should Know

There’s a funny truth in tech:

You can spend years learning Kubernetes, Docker, Terraform, CI/CD, and cloud platforms…
but sooner or later, everything still comes back to one thing:

Linux.

Servers run on Linux.
Containers run on Linux.
Most cloud systems rely on Linux.
Even modern DevSecOps pipelines silently depend on Linux permissions, users, file systems, and shell commands working correctly.

And yet many beginners jump directly into “advanced DevOps” without understanding the basics.

That’s like trying to fly a fighter jet before learning how steering works.

So in this blog, let’s break down Linux Fundamentals in a practical, beginner-friendly, and industry-focused way.


🚀 Why Linux Matters So Much

If you enter any of these fields:

  • DevOps
  • Cloud Engineering
  • Cybersecurity
  • Site Reliability Engineering (SRE)
  • Backend Development
  • Platform Engineering
  • Kubernetes Administration

…Linux becomes unavoidable.

Most production servers worldwide run Linux because it is:

  • Stable
  • Lightweight
  • Secure
  • Open-source
  • Highly customizable
  • Automation friendly

That’s why companies like:

  • Google
  • Amazon
  • Netflix
  • Meta

all heavily rely on Linux infrastructure.


🖥️ Understanding Linux Basics

Linux is an operating system kernel that powers many distributions (distros) like:

  • Ubuntu
  • Debian
  • CentOS
  • Fedora
  • Arch Linux

Think of Linux as the “engine” and distributions as different car models built around it.

In DevOps, the most commonly used distro is usually:

  • Ubuntu Server
  • Debian
  • RHEL / Rocky Linux

📂 Linux File System Explained

One of the first things beginners notice:

Linux does NOT use drives like:

C:\
D:\
Enter fullscreen mode Exit fullscreen mode

Instead, Linux starts from a single root directory:

/
Enter fullscreen mode Exit fullscreen mode

Everything exists under this root.


Linux File System

📁 Important Linux Directories

Directory Purpose
/ Root directory
/home User files
/etc Configuration files
/var Logs and variable data
/bin Essential commands
/tmp Temporary files
/root Root user home
/usr Applications and utilities

Example:

/home/rahul/projects
Enter fullscreen mode Exit fullscreen mode

means:

  • home directory
  • inside it → user rahul
  • inside it → folder projects

⚡ Essential Linux Commands

📍 1. Check Current Directory

pwd
Enter fullscreen mode Exit fullscreen mode

Output:

/home/ubuntu
Enter fullscreen mode Exit fullscreen mode

This tells you where you currently are.


📍 2. List Files

ls
Enter fullscreen mode Exit fullscreen mode

Detailed list:

ls -la
Enter fullscreen mode Exit fullscreen mode

This shows:

  • hidden files
  • permissions
  • ownership
  • timestamps

📍 3. Change Directory

cd /var/log
Enter fullscreen mode Exit fullscreen mode

Go back:

cd ..
Enter fullscreen mode Exit fullscreen mode

Go to home:

cd ~
Enter fullscreen mode Exit fullscreen mode

📍 4. Create Files & Folders

Create folder:

mkdir devops
Enter fullscreen mode Exit fullscreen mode

Create file:

touch notes.txt
Enter fullscreen mode Exit fullscreen mode

📍 5. Copy, Move & Delete

Copy:

cp file.txt backup.txt
Enter fullscreen mode Exit fullscreen mode

Move:

mv old.txt new.txt
Enter fullscreen mode Exit fullscreen mode

Delete:

rm file.txt
Enter fullscreen mode Exit fullscreen mode

Delete folder recursively:

rm -rf foldername
Enter fullscreen mode Exit fullscreen mode

⚠️ Be careful with rm -rf.

One wrong command can destroy an entire server.

Yes… this has happened in real companies.


🔍 Viewing File Content

View file:

cat file.txt
Enter fullscreen mode Exit fullscreen mode

Large files:

less file.txt
Enter fullscreen mode Exit fullscreen mode

Real-time logs:

tail -f app.log
Enter fullscreen mode Exit fullscreen mode

This is extremely common in DevOps troubleshooting.


🔐 Linux Permissions Explained

This is where Linux becomes VERY important for security.

Run:

ls -l
Enter fullscreen mode Exit fullscreen mode

You may see:

-rwxr-xr--
Enter fullscreen mode Exit fullscreen mode

Looks scary at first.

But it’s simple once broken down.


🧠 Permission Structure

Permission Demo
Example:

-rwxr-xr--
Enter fullscreen mode Exit fullscreen mode

Split it:

rwx | r-x | r--
Enter fullscreen mode Exit fullscreen mode

These represent:

Section Meaning
First Owner permissions
Second Group permissions
Third Others permissions

📌 Permission Types

Symbol Meaning
r Read
w Write
x Execute

🔧 Changing Permissions

Give execute permission:

chmod +x script.sh
Enter fullscreen mode Exit fullscreen mode

Specific permissions:

chmod 755 script.sh
Enter fullscreen mode Exit fullscreen mode

🤔 What is 755?

Numbers represent permissions:

Number Permission
7 rwx
5 r-x
5 r-x

So:

755
Enter fullscreen mode Exit fullscreen mode

means:

  • Owner → full access
  • Group → read & execute
  • Others → read & execute

This is very common for scripts and applications.


👤 Users & Groups in Linux

Linux is a multi-user operating system.

That means multiple users can work on the same machine securely.


👥 Create a User

sudo adduser rahul
Enter fullscreen mode Exit fullscreen mode

Set password and details.


👥 Create a Group

sudo groupadd developers
Enter fullscreen mode Exit fullscreen mode

🔗 Add User to Group

sudo usermod -aG developers rahul
Enter fullscreen mode Exit fullscreen mode

This is heavily used in:

  • DevOps teams
  • Shared servers
  • Kubernetes nodes
  • CI/CD runners

👑 The Root User

Linux has a superuser called:

root
Enter fullscreen mode Exit fullscreen mode

Root can do EVERYTHING.

That’s why production systems usually avoid direct root access.

Instead, admins use:

sudo
Enter fullscreen mode Exit fullscreen mode

Example:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

This temporarily gives admin privileges.


📦 Package Management

Linux installs software using package managers.

Ubuntu:

sudo apt install nginx
Enter fullscreen mode Exit fullscreen mode

CentOS/RHEL:

sudo yum install nginx
Enter fullscreen mode Exit fullscreen mode

or

sudo dnf install nginx
Enter fullscreen mode Exit fullscreen mode

🌐 Real DevOps Connection

Here’s the reality:

When CI/CD pipelines fail…

You often debug Linux.

When containers crash…

You inspect Linux logs.

When Kubernetes breaks…

You SSH into Linux nodes.

When cloud servers slow down…

You monitor Linux processes.

Linux is not “optional knowledge” anymore.

It is the foundation layer of modern infrastructure.


🔥 Linux Skills That Make You Valuable

Companies LOVE engineers who can:

✅ Navigate servers confidently
✅ Debug issues quickly
✅ Understand permissions
✅ Manage users securely
✅ Read logs efficiently
✅ Automate shell tasks
✅ Work comfortably in terminal environments

Because these skills directly impact:

  • uptime
  • security
  • deployments
  • incident response
  • infrastructure stability

Some Examples

🔹 Create users & groups

adduser testuser
Enter fullscreen mode Exit fullscreen mode

🔹 Change permissions

chmod 700 secret.txt
Enter fullscreen mode Exit fullscreen mode

🔹 Explore logs

cd /var/log
Enter fullscreen mode Exit fullscreen mode

🔹 Install software

sudo apt install nginx
Enter fullscreen mode Exit fullscreen mode

🔹 Create shell scripts

#!/bin/bash
echo "Hello Linux"
Enter fullscreen mode Exit fullscreen mode

💡 Final Thoughts

Most people try to skip Linux fundamentals because they look “basic.”

But experienced engineers know the truth:

The stronger your Linux foundation,
the easier DevOps, Cloud, Security, Docker, and Kubernetes become.

Linux is one of those skills that compounds over time.

At first, commands feel confusing.

Then one day, you realize you’re managing servers, automating deployments, debugging production issues, and writing shell scripts without even thinking.

That’s when Linux stops feeling like an operating system…

…and starts feeling like a superpower. 🚀

Top comments (0)