DevOps Day#3

ยท

2 min read

Basic Linux Commands with a Twist

Welcome to Day 3 of Linux exploration! Today's task is all about mastering basic Linux commands with some creative twists to enhance your learning. Below are the commands for each task, explained step-by-step.

Task 1: View the content of a file and display line numbers.

Task 2: Change the access permissions of files to make them readable, writable, and executable by the owner only.

Task 3: Check the last 10 commands you have run

Task 4: Remove a directory and all its contents.

Task 5: Create a fruits.txt file, add content (one fruit per line), and display the content.

1st method

2nd method

echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > fruits.txt  
cat fruits.txt

Task 6: Add content in devops.txt (one in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava. Then, append "Pineapple" to the end of the file.

1st method;

2nd method:


echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt  
echo "Pineapple" >> devops.txt  
cat devops.txt

Task 7: Show the first three fruits from the file in reverse order.

Task 8: Show the bottom three fruits from the file, and then sort them alphabetically.

Task 9: Create another file Colors.txt, add content (one color per line), and display the content.

Task 10: Add content in Colors.txt (one in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey. Then, prepend "Yellow" to the beginning of the file.

Task 11: Find and display the lines that are common between fruits.txt and Colors.txt.

Task 12: Count the number of lines, words, and characters in both fruits.txt and Colors.txt.

Everyday I will give my best as much as for DevOps aspirants to create valuable topics wise contents which are helps you clear doubts .

โ€œLinux mastery comes with consistent practice and curiosity. Keep exploring, and soon you'll be automating tasks like a pro! ๐Ÿš€โ€

ย