Day 3 : Basic Linux commands

Day 3 : Basic Linux commands

This is #90DaysofDevops challenge under the guidance of ShubhamLondhe sir

  1. To view what's written in a file.

“cat filename”

  1. To change the access permissions of files.

“chmod 777 foldername”

  1. To check which commands you have run till now.

“history”

  1. To remove a directory/ Folder.

    “rm filename” -> to remove the file

    “rmdir foldername” -> to remove folder

    “rm –r foldername” -> to remove folder recursively

To create a fruits.txt file and to view the content

“vim fruit.txt”

“cat fruit.txt”

Save and exit: If you want to save your changes and exit Vim, you can use the :wq command.

  1. Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.

Use command “vim devops.txt” and add the fruit one by one

  1. To Show only top three fruits from the file.

“cat devops.txt | head -3” is used to show only top 3 fruit from file.

  1. To Show only bottom three fruits from the file.

    “cat devops.txt | tail -3” is used to show only top 3 fruit from file.

  1. To create another file Colors.txt and to view the content.

    Use the command “vim color.txt” to create new file and add color name one by one

  2. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.

    To find the difference between devops.txt and Colors.txt files.

    “diff devops.txt color.txt” this command is used to find the difference between two files.