Hi šthere,
Now we are on the Day 3 task of the Linux Basic command.
Day 3 Task:
1. To view what's written in a file.
2. To change the access permissions of files.
3. To check which commands you have run till now.
4. To remove a directory/ Folder.
5. To create a fruits.txt file and view the content.
6. Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
7. Show only the top three fruits from the file.
8. Show only the bottom three fruits from the file.
9. To create another file Colors.txt and to view the content.
10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.
11. To find the difference between the fruits.txt and Colors.txt files.
Linux command to view whatās written in a file?
The #cat command is used to display whatās written in a file.
Linux command to change the access permissions of files?
The #chmod command is used to change the access permissions of files
Linux command to check which commands you have run till now?
The #history command is used to check which commands you have run till now
Linux command to remove a directory/ Folder?
The #rmdir command is used to remove a directory/ folder.
To create a fruits.txt file and view the content?
The #vim fruits.txt is used to create a fruits.txt file and to view the content.
Add content in devops.txt (One in each line) ā Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava?
The #vim devops.txt and add fruits name one by one.
To show only the top three fruits from the file?
The#cat devops.txt | head -3 is used to show only the top three fruits from the file
Show only the bottom three fruits from the file?
The#cat devops.txt | tail -3 is used to show only the bottom three fruits from the file.
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?
The #vim Colors.txt and add colours name one by one.
To find the difference between the fruits.txt and Colors.txt files?
The #diff fruits.txt colors.txt is used to find the difference between the fruits.txt and Colors.txt files.
Please, feel free to drop any questions in the comments below. I would be happy to answer them.
If you find this post helpfulšš, please follow and click the heartā¤ā¤ button below to show your support.
_ Thank you for reading
_sandhya kumari