#11 Linux - Networking - Shell Scripting

"Passionate DevOps enthusiast, automating workflows and optimizing infrastructure for a more efficient, scalable future."
🌱 Reflection — From Shell Scripts to Self-Belief
The past few days have been nothing short of transformative.
From learning the basics of shell scripting to realizing —
“Hey, this actually makes sense… I can do this.”
It started with curiosity and a bit of confusion, but with each command typed, each concept revisited — especially while practicing Linux and revising networking fundamentals — I began to see how far I’ve come from where I once was.
There’s still a long way to go, but looking back, it feels good to acknowledge the progress — the small wins, the growing clarity, and the confidence that builds quietly through consistent learning.
If there’s one thing I’ve truly enjoyed in this journey, it’s learning itself — the process, the patience, and the feeling of slowly mastering what once felt impossible.
🐧 Mastering Linux: From Basics to Power User — A Complete Practical Guide
“Once you understand Linux, you understand how computers truly work.”
— Anonymous
Linux isn’t just an operating system — it’s a universe of control, freedom, and automation. Whether you’re a DevOps engineer, developer, or cloud enthusiast, mastering Linux is non-negotiable.
In this guide, I’ll take you through everything — from Linux architecture, user management, and process control, to system monitoring, file permissions, and storage management — all simplified and practical.
🧩 What is Linux?
Linux is an open-source operating system that acts as a bridge between your hardware and software. It is free, customizable, and powers everything from personal computers to servers, mobile phones, and even satellites.
🧱 Core Components of a Linux System
Key Layers:
Hardware: The physical layer (CPU, RAM, Disks, etc.)
Kernel: The brain — manages processes, memory, devices, and filesystems.
Shell: The interpreter between user and kernel (e.g., Bash).
User Applications: Everything from browsers to Docker.
🧰 Popular Linux Distributions
Linux comes in many flavors called distributions (distros) — each optimized for a purpose.
| Distro | Use Case |
| Ubuntu | Beginner-friendly, personal use, servers |
| Debian | Stable and reliable base system |
| Fedora | Developer-focused with new features |
| Arch Linux | Minimal, for advanced users |
| Kali Linux | Cybersecurity and penetration testing |
| Alpine Linux | Lightweight for containers |
| Rocky/AlmaLinux | Enterprise-grade replacements for CentOS |
⚙️ Setting up Linux on Windows or macOS
You don’t need a dedicated machine to explore Linux. You can use:
Cloud VMs (AWS EC2, Azure, GCP)
WSL2 (Windows Subsystem for Linux)
VirtualBox / VMware
Docker Containers ✅ (lightweight and preferred)
Run Ubuntu in Docker
docker run -dit \
--name ubuntu-container \
--hostname ubuntu-dev \
--restart unless-stopped \
--cpus="2" \
--memory="4g" \
--mount type=bind,source=~/docker/data,target=/data \
ubuntu:latest /bin/bash
🧠 Pro Tip:
Avoid mounting directories from/tmpon macOS — they get deleted automatically.
Use~/docker/datafor persistent mounts.
🏗️ Understanding Linux Folder Structure
| Directory | Description |
/ | Root of everything |
/home | User directories |
/etc | Configuration files |
/usr | Installed applications |
/var | Logs and variable data |
/tmp | Temporary files (cleared on reboot) |
/proc | Virtual process information |
/sys | Kernel and device data |
/dev | Device files |
/mnt, /media | Mount points for external drives |
👤 User Management in Linux
Linux is a multi-user system. Every user, group, and privilege is managed carefully for security.
Create a User
useradd -m -s /bin/bash username
passwd username
Add to Sudoers
usermod -aG sudo username # Debian-based
usermod -aG wheel username # RHEL-based
Delete a User
userdel -r username
Manage Groups
groupadd devops
usermod -aG devops piyush
groups piyush
📁 File Management Commands
| Task | Command |
| List files | ls -l |
| Change directory | cd /path |
| Create folder | mkdir foldername |
| Remove file/folder | rm file.txt, rm -r folder/ |
| Copy/move files | cp, mv |
| View file content | cat, less, head, tail |
✍️ VI Editor — The Power of Text Editing
i→ insert modeEsc→ normal mode:wq→ save and quitdd→ delete lineyy→ copy linep→ paste
🚀 Mastering
viis like unlocking the true power of Linux.
🔐 File Permissions & Ownership
Each file has three access levels — user, group, others.
| Permission | Symbol | Numeric |
| Read | r | 4 |
| Write | w | 2 |
| Execute | x | 1 |
Change Permissions
chmod 755 script.sh
Change Ownership
chown piyush:devops script.sh
Special Permissions
SetUID (
chmod u+s) → Run as file ownerSetGID (
chmod g+s) → Inherit groupSticky Bit (
chmod +t) → Only owner can delete (used in/tmp)
⚡ Process Management
Everything running in Linux is a process.
| Command | Description |
ps aux | List all processes |
top / htop | Monitor processes interactively |
kill PID | Stop a process |
bg, fg, jobs | Manage background processes |
systemctl start nginx | Start a service |
systemctl enable sshd | Auto-start at boot |
🔄 Each process has a PID and a parent process — forming a process tree.
📊 System Monitoring
| Resource | Command | Example |
| CPU & Memory | top, htop, vmstat | vmstat 1 5 |
| Memory | free -m | Check RAM usage |
| Disk Usage | df -h, du -sh /var/log | Space usage |
| Network | ip a, ping, ss -tulnp | Connectivity |
| Logs | journalctl -f, tail -f /var/log/syslog | Real-time logs |
💾 Disk & Storage Management
| Task | Command |
| View disks | lsblk, fdisk -l |
| Create partition | fdisk /dev/sdb |
| Format | mkfs.ext4 /dev/sdb1 |
| Mount | mount /dev/sdb1 /mnt |
| LVM | pvcreate, vgcreate, lvcreate |
| Swap space | mkswap, swapon, swapoff |
💡 For permanent mounts, add entries to
/etc/fstab.
🧠 Key Takeaways
Linux is layered, modular, and powerful.
Avoid temporary paths like
/tmpfor long-term storage.Always check permissions (
ls -l) before executing scripts.Use
systemctl,ps, andtopto keep your system under control.Learn once, apply everywhere — whether it’s Docker, AWS EC2, or Kubernetes, Linux is the foundation.
🚀 Final Thought
Learning Linux is not about memorizing commands — it’s about understanding how the system thinks. Once you do, you’ll never feel locked out of any system again.
“With great terminal power, comes great system responsibility.” 🖥️
📚 If you found this helpful:
Follow my journey on Hashnode
Connect with me on LinkedIn
Share this post with someone learning DevOps or Cloud 🚀



