Day 3: Mastering Linux Commands

This marks as the third day of the 90 days of DevOps Challenge

Β·

3 min read

Day 3: Mastering Linux Commands

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

  1. 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! 😺

  1. 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! 🏰

  1. 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! πŸš€

  1. 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! ✨

  1. 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! πŸ›’

  1. 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!

  1. 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! 🎩

  1. 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! πŸ‘ 

  1. 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! πŸŽ¨πŸ–οΈ

  1. 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! πŸ“’

  1. 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! πŸš€πŸŒŸ

Β