Phase 2: Mastering Linux System Insight Commands for DevOps & SysAdmins


- Level: Beginner
- Estimated Time: ~20โ25 minutes
- Tools Used: Linux Terminal / CLI
- Outcome: You'll gain visibility into your system's behavior, performance, and usage key for DevOps and DevSecOps work.
If youโve nailed Phase 1: File and Directory Mastery, take a moment to celebrate ๐. Youโve built your foundation. Now it's time to understand what your system is doing under the hood like checking your carโs dashboard while driving.
Welcome to Phase 2: System Insight Tools, where youโll learn how to monitor system health, processes, and performance a must for every DevOps pro, SRE, or power user.
๐ Why This Phase Matters
โ
Helps diagnose performance issues
โ
Core foundation for DevOps & sysadmin tasks
โ
Lets you observe, troubleshoot, and secure your system like a pro
๐ What Youโll Learn
- Monitor disk usage and free space
- Understand RAM usage and availability
- Visualize directory structure
- List running processes and system activity
- Identify logged-in users and user permissions
โ Start Here: Where Are You?
pwd
Always know where you're starting from especially when redirecting output.
๐ณ tree
โ> Visualize Directory Structure
tree
tree -L 2
Get a visual map of your folders.
๐ก
-L 2
limits depth great for big folders.โ ๏ธ If not installed:
sudo apt install tree
๐ฝ du -sh *
โ> Folder-by-Folder Disk Usage
du -sh *
-s
: summary only-h
: human-readable sizes*
: all items in the directory
๐ Use this in your
~/Downloads
or~/Projects
folder to spot heavy folders.
๐งฑ df -h
โ Disk Space on Mounted Devices
df -h
See total size, used, available, and usage % for your drives.
โ๏ธ Use
du
for per-folder size; usedf
for whole disk partitions.
๐ง free -h
โ> RAM & Swap Usage
free -h
Breaks down:
- Total / Used / Free RAM
- Swap memory usage
๐จ Useful to check before/after running heavy scripts.
๐ ps aux
โ> All Running Processes
ps aux
See everything running in the background from apps to daemons.
๐ง Combine with grep:
ps aux | grep nginx
๐ top
/ htop
โ> Live System Monitor
top
htop # If installed
top
: default, updates every few secondshtop
: colorful, interactive (use arrow keys, F6 to sort)
โ Install htop:
sudo apt install htop
๐ค whoami
โ> Current User
whoami
See your current user crucial when working across user roles or sudo environments.
๐ id
โ> User ID and Group Info
id
Displays:
- UID (User ID)
- GID (Group ID)
- All groups the user belongs to
๐ Understanding permissions starts here.
โ๏ธ System Snapshot Script
Try running this full system snapshot in your terminal:
echo "--- System Health Check ---"
echo "Current Directory: $(pwd)"
echo ""
echo "--- Disk Usage (Current Folder) ---"
du -sh *
echo ""
echo "--- Overall Disk Space ---"
df -h
echo ""
echo "--- RAM Usage ---"
free -h
echo ""
echo "--- Top 5 CPU Processes ---"
ps aux --sort=-%cpu | head -n 6
echo ""
echo "--- Current User Info ---"
whoami
id
echo "--------------------------"
๐ Summary Table
Command | What It Does | Example |
pwd | Show current directory | pwd |
tree | Visualize folder structure | tree -L 2 |
du -sh * | Show size of each item in current dir | du -sh * |
df -h | Disk usage across all mounted devices | df -h |
free -h | RAM and swap usage | free -h |
ps aux | All active processes | ps aux |
top / htop | Real-time system monitor | htop |
whoami | Your current user | whoami |
id | User + group IDs | id |
๐งช Mini Challenge: Log Your System State
Try this workflow:
mkdir ~/sys-check
cd ~/sys-check
tree ~ > tree.txt
df -h > disk.txt
free -h > memory.txt
ps aux --sort=-%mem | head -n 10 > top-memory.txt
Then review the files using:
cat memory.txt
cat top-memory.txt
๐ Whatโs Next: Text Manipulation & Permissions
In Phase 3, you'll learn to:
- View and edit text files
- Chain commands with pipes
- Manage file permissions (
chmod
,chown
) - Start scripting automation basics
This is where the shell becomes your superpower. ๐ช
Author: Abdulrahman A. Muhamad
๐ Portfolio โข GitHub โข LinkedIn
Subscribe to my newsletter
Read articles from Abdulrahman Ahmad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Abdulrahman Ahmad
Abdulrahman Ahmad
๐ Code. Automate. Innovate. Hi, Iโm Abdulrahman, a passionate DevOps Engineer and Software Developer on a mission to bridge the gap between code and production. With a love for automation, cloud-native solutions, and cutting-edge tech, I turn complex problems into seamless, scalable systems. ๐ก What I Do: Build robust CI/CD pipelines that deliver software at the speed of thought. Architect cloud infrastructure that scales with a single command. Transform manual processes into automated workflows that just work. Break down silos and foster collaboration between teams. ๐ง Tech Stack I โค๏ธ: Containers (Docker), Orchestration (Kubernetes), Infrastructure as Code (Terraform), CI/CD (Jenkins, GitLab), Cloud (AWS/GCP/Azure), and scripting like itโs my superpower. ๐ Why This Blog? This is where I share my journey, lessons learned, and the latest trends in DevOps and software engineering. Whether you're a seasoned pro or just starting out, join me as we explore the tools, tricks, and best practices that make the tech world tick. ๐ Letโs Build the Future, One Pipeline at a Time. Connect with me, share your thoughts, and letโs automate the world together!