Task: What is the linux command to
To view what's written in a file.
$ cat <filename.txt>
To change the access permissions of files.
$ sudo chmod g+rwx <filename>
To check which commands you have run till now.
$ history
To remove a directory/ Folder.
$ rm -rf <foldername>
To create a fruits.txt file and to view the content.
$ vim fruits.txt
# creates a fruits.txt file and takes you to the editor, press i to enter into edit mode and write the content. Save it by esc and :wq! enter
$ cat fruits.txt
# prints the content from 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.
To Show only bottom three fruits from the file.
$ vim devops.txt
$ cat devops.txt
$ head -n 3 devops.txt
$ tail -n 3 devops.txt
To create another file Colors.txt and to view the content.
Add content in Colours.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
$ vim colours.txt
$ cat colours.txt
To find the difference between fruits.txt and Colours.txt file.
$ diff fruits.txt colours.txt
Reference: https://www.linkedin.com/pulse/linux-commands-devops-used-day-to-day-activit-chetan-/