🌍 Day 4 of My DevOps Journey: Monitoring, Managing, and Automating Like a Linux Pro!

SathyaSathya
3 min read

🧠 What I Learned Today

Today was one of those days that made me feel closer to the heart of a real system admin. I explored powerful Linux commands that help monitor system performance, understand what's running under the hood, and even automate tasks like a pro.


⚙️ Here's what I covered:

🧩 1. df — Disk Space Usage

Used df -h to display available disk space in a human-readable format.

Fun fact: The "Mounted on" column tells you where your device is connected in the directory tree.


🧹 2. du — Directory Disk Usage

Used du -sh * to find out how much space each file and folder is taking up. Super useful to spot space hogs!


💻 3. top — Live System Monitor

My fav of the day! It shows real-time processes, CPU, memory usage, and more.

I even checked for zombie processes (thankfully, I had 0 🧟‍♂️).


🧼 4. ps & kill — Managing Processes

I used ps to list running processes and kill to stop them using their PID.
And if a process refuses to die?

will use kill -9 PID — that's the SIGKILL. 😈


🕒 5. crontab — Scheduling Tasks

I scheduled a bash script to run every hour using crontab -e.
The script logs disk usage to a file — real-world automation ftw!

0 * * * * /home/user/disk_check.sh

🧾 6. grep — Pattern Searching

Learned how to search for patterns inside files like a pro.

grep -i 'word' filename is case-insensitive and sleek!


🐍 7. awk — Text Processing Wizard

Honestly? I loved this one. With one command, I could filter and format data based on conditions.
Example: Print names of students who scored above 80:

awk '$2 > 80 {print $1}' marks.txt

🧪 Real Practice: Disk Monitoring Script

#!/bin/bash

THRESHOLD=80
USAGE=$(df -h / | grep '/' | awk '{print $5}' | sed 's/%//')
TIME=$(date)
LOGFILE="$HOME/disk_usage.log"

if [ "$USAGE" -ge "$THRESHOLD" ]; then
    echo "$TIME WARNING: Disk usage is at ${USAGE}%!" >> $LOGFILE
else
    echo "$TIME OK: Disk usage is at ${USAGE}%." >> $LOGFILE
fi

This script + crontab = magic 💫
Now my system logs disk usage hourly without me lifting a finger.


💡 Key Takeaways

  • You don’t need GUI tools to manage a Linux system efficiently.

  • Text processing is powerful. Commands like grep and awk are irreplaceable.

  • Cron is a superpower. One line and your system works for you.

  • Monitoring is not optional. If you're not measuring your system, you're flying blind.


💭 How I Felt Today

"I didn’t just learn commands. I learned control."

There was something empowering about seeing my script run on schedule. It reminded me that I’m not just studying DevOps — I’m becoming it.


✨ If you’re following a similar path, drop a comment — let’s learn and grow together!
Till then, keep hacking the terminal and hacking your mindset. 💻💫

#DevOpsJourney #100DaysOfDevOps #LinuxForBeginners #CronJobs #ShellScripting #WomenWhoCode #Hashnode


0
Subscribe to my newsletter

Read articles from Sathya directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sathya
Sathya