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 [mention_permissions] [filename]
- To check which commands you have run till now.
$ history
- To remove a directory/ Folder.
$ rmdir [filename]
$ rm -r [filename]
- To create a fruits.txt file and to view the content.
$ touch [filename]
$ cat [filename]
- Add content in fruits.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
$ vim [filename]
$ vi [filename]
$ nano [filename]
- To Show only the top three fruits from the file.
$ head -3 [filename]
- To Show only the bottom three fruits from the file.
$ tail -3 [filename]
- 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, and Grey.
$ vim Colors.txt
- To find the difference between the fruits.txt and Colors.txt files.
$ diff fruits.txt Colors.txt
Day 3 Task completed
90DaysOfDevOps Tasks👇