Welcome back to Day 26 of my #100DaysOfLinux challenge!
Today, you're not just reading — you're playing along 🎮.
We’re diving deep into essential Linux CLI tools:
grep
find
head
/tail
wc
Ready? Let’s go 💪
📚 Table of Contents
- 🔧 Step 1: Create Your Sample File
- 🚨 Challenge 1: grep Games
- 🕵️♀️ Challenge 2: Find It Like a Pro
- 📜 Challenge 3: Head & Tail of the Story
- 🧪 Challenge 4: Count Me In (wc)
- 🤖 Bonus Challenge: Find the Unmatched Lines
- 🏆 Your Turn!
🔧 Step 1: Create Your Sample File
Before we jump into the challenges, let’s create a simple file with mixed log lines:
This file (file.txt
) will be our playground today.Then check with cat file.txt.
🎯 The Tools & Commands You’ll Use
Before the challenge, here's your weapon list:
Command | Purpose |
---|---|
grep |
Pattern matching (search inside files) |
find |
Locate files and folders |
head |
Show beginning of files |
tail |
Show end of files |
wc |
Count words, lines, bytes |
🚨 Challenge 1: grep Games
🎯 Task:
- Find all lines that start with "ERROR".
- Find lines that end with "completed".
- Ignore case and search for "warning".
- Show lines that do not contain "INFO".
- Count how many times "404" appears.
💡 Hints:
🕵️♀️ Challenge 2: Find It Like a Pro
🎯 Task:
- Find all
.log
files in/var/log
. - Find all
.sh
files modified in the last 2 days. - Find all empty
.txt
files.
💡 Hints:
📜 Challenge 3: Head & Tail of the Story
🎯 Task:
- Show the first 5 lines of a file.
- Show the last 15 lines.
- Watch a log file update live.
💡 Hints:
🧪 Challenge 4: Count Me In (wc)
🎯 Task:
- Count number of lines in a file.
- Count total words.
- Get line + word + byte count together.
💡 Hints:
🤖 Bonus Challenge: Find the Unmatched Lines
🎯 Task:
You have two config files: config.old
and config.new
.
Find which lines are in config.old
but not in config.new
.
💡 Hint:
grep -v -F -x -f config.new config.old
🏆 Your Turn!
Pick any 3 challenges above and try them out in your terminal.
Then come back and drop a comment:
- ✅ Which one did you complete?
- 🚤 Which one was hard?
- 🚀 Which one was fun?
#30DaysLinuxChallenge #CloudWhisler
DevOps #Linux #RHCSA #Opensource #AWS #CloudComputing
Catch out by My LinkedIn profile
https://www.linkedin.com/in/rajpreet-gill-4569b4161/
Top comments (0)