Day3 #90daysofdevops Challenge
In this blog we'll learn how we can drive certain tasks in Linux using shell:
Table of contents
No headings in the article.
To view what's written in a file.
cat filename
To change the access permissions of files.
chmod
To check which commands you have run till now.
history
.
.
To remove a directory/ Folder.
rmdir directoryname
To create a fruits.txt file and to view the content.
touch fruits.txt
cat fruits.txt
Add content in fruits.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava
cat >> fruits.txt
Apple
Mango
Banana
Cherry
Kiwi
Orange
Guava
ctrl + d
Show only the top three fruits from the file.
head -3 fruits.txt
Show only the bottom three fruits from the file.
tail -3 fruits.txt
To create another file colors.txt and to view the content.
touch colors.txt
cat colors.txt
Add content in colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey
cat >> colors.txt
Red
Pink
White
Black
Blue
Orange
Purple
Grey
ctrl + d
To find the difference between the fruits.txt and colors.txt file
diff fruits.txt colors.txt