DEV Community

Cover image for Linux Challenge #1: The Power of Basics – Can You Automate This?
Muhammad Zulqernain Zahid
Muhammad Zulqernain Zahid

Posted on

Linux Challenge #1: The Power of Basics – Can You Automate This?

Hey there, Terminal Warriors!

You've made it through the core commands: mkdir, touch, cat, rm, cp, and mv. Now it’s time to apply them all together in a practical challenge that'll push your command-line confidence to the next level.

This challenge is meant for RHEL 9 learners following my series — but anyone who loves some good terminal automation fun can jump in!


Challenge Brief

You're asked to quickly organize a project workspace for a small dev team.

Here’s what needs to be done:

📝 Task Overview

  1. Create a project directory named team_alpha.
  2. Inside it, create the following structure:
   team_alpha/
   ├── docs/
   ├── src/
   │   ├── frontend/
   │   └── backend/
   ├── tests/
Enter fullscreen mode Exit fullscreen mode
  1. Inside docs/, create 3 files: README.md, CONTRIBUTING.md, and LICENSE.
  2. Inside src/frontend/, create files: index.html, style.css.
  3. Inside src/backend/, create files: app.py, requirements.txt.
  4. Append a line of dummy content to README.md and app.py.
  5. Rename README.md to README_MAIN.md.
  6. Copy requirements.txt to the main team_alpha/ directory.
  7. Delete the tests/ directory.

Full Solution Walkthrough

# Step 1: Create the base project directory
mkdir team_alpha

# Step 2: Create nested structure with -p (recursive flag)
mkdir -p team_alpha/docs team_alpha/src/frontend team_alpha/src/backend team_alpha/tests

# Step 3: Create files in docs/
touch team_alpha/docs/README.md team_alpha/docs/CONTRIBUTING.md team_alpha/docs/LICENSE

# Step 4: Create files in frontend
touch team_alpha/src/frontend/index.html team_alpha/src/frontend/style.css

# Step 5: Create files in backend
touch team_alpha/src/backend/app.py team_alpha/src/backend/requirements.txt

# Step 6: Add dummy text to README.md and app.py
echo "This is the README file." > team_alpha/docs/README.md
echo "# Python App" > team_alpha/src/backend/app.py

# Step 7: Rename README.md
mv team_alpha/docs/README.md team_alpha/docs/README_MAIN.md

# Step 8: Copy requirements.txt to the root of the project
cp team_alpha/src/backend/requirements.txt team_alpha/

# Step 9: Delete the tests folder
rm -rvf team_alpha/tests
Enter fullscreen mode Exit fullscreen mode

🧠 What You Just Practiced

Command Purpose
mkdir -p Creates nested directory structure
touch Creates empty files
echo > Writes dummy content to files
mv Renames a file or moves it
cp Copies a file
rm -rvf Deletes a folder and everything inside, recursively

Mini Challenge

Take it up a notch! Add a script that automates the above setup, but accepts the project name as an argument.

Hint:

#!/bin/bash
project_name=$1

# Use "$project_name" in place of team_alpha above
Enter fullscreen mode Exit fullscreen mode

Want me to help you with the script version? Let me know in the comments 👇


Keep Practicing

Every time you build something small like this, you're building muscle memory. Try modifying this structure to suit different projects — and see how fast you get with automation!


Tags:

#linux #redhat #rhcsa #techwithengineers #techtransition #learnlinux #devops #linuxlab #cloudwhistler #30daychallenge #opensource #techjourney

Top comments (0)