🎉 Day 5 of #90DaysOfDevOps: Advanced Linux Shell Scripting & User Management! 🚀

Hey, Hashnode community! 🌟 Today’s challenge in my #90DaysOfDevOps journey was super exciting! We leveled up by diving into advanced Linux shell scripting and user management. Let me break it down! 🎯


🚀 90 Directories in Seconds!

No need to create 90 directories manually! With this command, you can create them all in one go:

mkdir day{1..90}

Easy, right? 💡 Linux shell scripting is the ultimate productivity hack! 💥


🛠️ Dynamic Directory Creation Script

What if you want more flexibility in creating directories? Here’s a bash script that lets you specify the directory name and number range! Run it like this:

./createDirectories.sh day 1 90

This will create directories named day1, day2… up to day90. Here’s the magic behind it:

#!/bin/bash
prefix=$1
start=$2
end=$3

for i in $(seq $start $end)
do
   mkdir "$prefix$i"
done

echo "Directories created successfully! 🎉"

🔐 Backup Like a Pro

In the world of DevOps, backups are non-negotiable! Today, I wrote a backup script that zips up my work, and soon I’ll integrate it with cron for automation. Backups on autopilot—what could be better? 🔥


👥 Managing Linux Users

User management is key to a healthy system. Today, I created two new users with this command:

sudo useradd alice
sudo useradd bob

Alice and Bob are now onboard! 🎉 Linux makes managing users smooth and efficient. 🔑


🤖 Cron: Automating It All

Automation is at the heart of DevOps. Using cron, I’ll schedule my backup script to run daily and ensure I never lose any work. It’s like having a personal assistant for your system! 🛠️


✨ My Takeaway:

Today, I dove deeper into advanced scripting and user management—two essential skills in DevOps. These tasks have sharpened my automation skills and made me more efficient. What’s your experience with shell scripting? Share below! 💬

#DevOps #ShellScripting #Automation #CronJobs #LinuxUserManagement #TechJourney #LearnByDoing

0
Subscribe to my newsletter

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

Written by

Kanav Preet Singh
Kanav Preet Singh