Skip to main content

Command Palette

Search for a command to run...

Day 3 :- Basic Linux Commands with a Twist šŸ§šŸ’»

Updated
•2 min read
Day 3 :- Basic Linux Commands with a Twist šŸ§šŸ’»
A

"I'm a 3rd-year Computer Engineering student at Marwadi University with skills in C++, web development (MERN stack), and DevOps tools like Kubernetes. I contribute to open-source projects and share tech knowledge on GitHub and LinkedIn. I'm learning cloud technologies and app deployment. As an Internshala Student Partner, I help others find jobs and courses." now currently focusing on #90DaysOfDevops

DAY 3 :- TASK

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

cat -n #filename

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

chmod 777 #filename

3. Check the last 10 commands you have run.

history | tail -10

4. Remove a directory and all its contents.

rm -r #directoryname

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

touch fruits.txt #creating file
vim fruits.txt #editing file as one fruite per line
cat fruits.txt #display the content

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.

vim fruits.txt #editing file as one fruite per line
cat fruits.txt #display the content
echo "pineapple" >> fruits.txt #adding pineapple in last of fruits.txt
cat fruits.txt #display the content

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

head -3 #filename | tac

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

tail -3 #filename | sort

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

vim #file name
cat #file name

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

comm -12 <(sort *filename1) <(sort *filename2)

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

wc #file name

Thank you for reading!

Ā© 2024 Anand Raval. All rights reserved.

90DaysOfDevops

Part 47 of 49

So In This Series I am following 90 DaysOfDevops challenge , what i will learn in my devops journey i will share with you with my blogs ,You will get blog on tools which used by devops engineer , example :- Linux,ansible,terraform,docker,etc

Up next

Day 2 :- History Of Linux And Basic Linux Commands šŸ§šŸ’»

Day 2 :- TASK • What is Linux ? Linux is a free and open-source software operating system , which is based on UNIX, is well-known for its strong security, reliability, and high performance. It is very flexible, receives regular software updates, an...

More from this blog

A

Anand Raval

118 posts

Hello I am Anand Raval , i contributed my work in robotics(arduino uno) , fronted web devloper,competitive programming, now currently focusing on #90DaysOfDevops