Day 3: Mastering Linux Commands
This marks as the third day of the 90 days of DevOps Challenge
Table of contents
Introductionπ
Hey there, fellow DevOps adventurers!
Welcome to Day 3 of our epic 90 Days of DevOps journey! ππToday's escapade took us into the wild and wacky realm of Linux commands! Buckle up because we're about to dive deep into the magical world of file management, permission handling, command history, and even some funky file comparisons! π§ββοΈπππ
Imagine yourself as a DevOps wizard, wielding the power of Linux commands like a boss! You've got the skill, and you're ready to conquer the command line! πͺπ»
Taskπ―
Solution
- To view what's written in a file. π
cat <file-name>
It's like calling a curious cat to read the contents of a file for you! πΊ
To change the access permissions of files. π
chmod <permission-command> <file/directory-name>
Think of it as playing "house" with your files, giving them different levels of security! You're the master of file access! π°
- To check which commands you have run till now. β³
history
It's like having a personal time machine that shows you all the past commands you've ever used! π
- To remove a directory/ Folder. ποΈ
rmdir <directory-name>
#or
rmdir -r <directory-name>
Imagine telling the computer to tidy up and delete an empty folder. It's like Marie Kondo for your files! β¨
To create a fruits.txt file and to view the content. ππ
touch fruits.txt cat fruits.txt
You're creating a shopping list for fruits! First, you prepare the empty bag, and then you peek inside to see what you need to buy! π
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava. ππ₯πππ₯ππ
echo -e "\Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt
You're dictating the list of yummy fruits to your computer like a friendly fruit vendor! ππ₯π Pick the best ones!
Show only the top three fruits from the file. πππ
sort devops.txt | head -n 3 devops.txt
It's like wearing a hat and just showing off the first three fruits from the list! Ta-da! π©
Show only the bottom three fruits from the file. πππ₯₯
sort devops.txt | tail -n 3 devops.txt
This time, we're showing off our fancy shoes (tail) and revealing the last three fruits! π
To create another file Colors.txt and to view the content. π¨π
touch Colors.txt cat Colors.txt
Now you're getting artistic! Creating a blank canvas for your colors and then peeking inside to see the beautiful hues! π¨ποΈ
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey. β€οΈππ€π€ππ§‘ππ€
echo -e "\Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt
It's like announcing the colors you want to paint with, loud and clear! π’
To find the difference between fruits.txt and Colors.txt files. πππ¨
diff fruits.txt Colors.txt
You're becoming a detective now, spotting the variations between your fruit list and your color palette! ππ΅οΈββοΈ
There you have it, a delightful and emoji-filled guide to these commands! Have fun and happy computing! ππ»
Conclusionβ¨
Ah, Linux commands, are the backbone of the DevOps universe! ππ» Mastering these magical tools is like unlocking the secrets to streamline processes, automate tasks, and troubleshoot like a pro! It's like having a superpower that makes us DevOps superheroes! π¦ΈββοΈπ¦ΈββοΈ
So, let's keep practicing and playing with these commands! The more we tinker with them, the more they'll become our trusty sidekicks in this epic DevOps adventure! πͺ
Remember, even the greatest cities weren't built overnight, and neither will our DevOps mastery! It's a journey, a continuous exploration of new skills and knowledge. But fear not, dear DevOps travelers, for together, we shall conquer all the challenges that come our way! ποΈπΊοΈ
Keep up the incredible work, and get ready for Day 4 of our thrilling 90 Days of DevOps journey! See you tomorrow, fellow DevOps adventurers! ππ