Day 3 Task: Basic Linux Commands
Task: What is the linux command to
To view what's written in a file.
cat
filename
To change the access permissions of files.
chmod 400 filename
To check which commands you have run till now.
history
To remove a directory/ Folder.
rmdir directory-name
rm -rvf file-name
To create a fruits.txt file and to view the content.
vim fruits.txt
cat fruits.txt
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava
To Show only top three fruits from the file.
head -3 devops.txt
To Show only bottom three fruits from the file.
tail -3 devops.txt
To create another file Colors.txt and to view the content.
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey
.
To find the difference between fruits.txt and Colors.txt file.
diff fruits.txt Colors.txt