Table of contents
- a) To view the content of the file
- b) To change the access permissions of files
- c) To check which commands you have run till now.
- d) To remove a directory/ Folder.
- e)To create a fruits.txt file and view the content
- f) Add content in fruit's.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
- g) To Show only the top three fruits from the file.
- h) Show only the bottom three fruits from the file.
- i) To create another file Colors.txt and to view the content.
- j)Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.
- k) To find the difference between fruits.txt and Colors.txt files.
Welcome to Day 3 of the #90DaysOfDevOps challenge. Today we will be exploring some more basic Linux commands that are essential for any DevOps engineer. These commands will help you navigate and manage your Linux system efficiently. So, let's dive in!!!
a) To view the content of the file
cat <filename> # To view the content of any text file.
b) To change the access permissions of files
chmod 777 <filename> # To provide all access including read,write
#and execute
c) To check which commands you have run till now.
history # To check command which was previously run
d) To remove a directory/ Folder.
rmdir <Directory> # To remove a directory
e)To create a fruits.txt file and view the content
touch <file.txt> # To create a file
echo "Content to be added in file" > file.txt #To add content in a file
cat <filename.txt> # To view the content of any text file.
Since no content in Colors.txt why it prints nothing .
f) Add content in fruit's.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
vim filename.txt # Create a text file and add content in it
cat filename.txt # To view the content of any text file.
g) To Show only the top three fruits from the file.
head -n 3 filename # To show top three content in the file
h) Show only the bottom three fruits from the file.
tail -n 3 filename # To show bottom 3 content from the file
i) To create another file Colors.txt and to view the content.
touch <file.txt> # To create a file
cat <filename.txt> # To view the content of any text file.
Since no content in Colors.txt why it prints nothing .
j)Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.
echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > filename.txt
k) To find the difference between fruits.txt and Colors.txt files.
diff <firstfile.txt> <secondfile.txt> #The diff command will show
# the lines that are different
#between the two files,
#highlighting any changes made.
These are some basic Linux commands that will prove helpful throughout your DevOps journey. Understanding and practicing these commands will enable you to navigate and manage your Linux system with ease.
That's all for Day-3 of the #90DaysOfDevOps challenge. Stay tuned for Day 4 of the #90DaysOfDevOps challenge, where I'll explore basic Linux Shell scripting for DevOps Engineers.
Connect with me on Twitter, Linkedin, and Github.
If you found this blog post helpful, please consider sharing it with others who might benefit from it and share your valuable feedback.