#Day3 of 90daysdevops

#Day3 of 90daysdevops

Basic Linux commands

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

    -->cat <file name>

  2. To change the access permissions of files?

    -->chmod 777 <file name>

  3. To check which commands you have run till now?

    -->History

    1. To remove a directory/ Folder?

      -->rmdir <folder name>

      -->rm -r <folder name>

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

      -To create a fruits.txt file:

      -->touch fruits.txt

      • to view the content of file:

      • -->cat fruits.txt

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

      -->vim devops.txt

      1)to enable the insert option click on i key.

      2)then add Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.

      3)press esc key to get out off insert mode,then press :x(save & quit).

      1. to show only top 3 fruits from the file?

        -->Head -3 devops.txt

      2. to show only bottom 3 fruits from the file?

        -->Tail -3 devops.txt

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

        -to create colour.txt file

        -->cat > colours.txt

        -to view content of file

        -->cat < colours.txt

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

        --> cat > colours.txt

        add the content

        ctrl + d

To find the difference between fruits.txt and Colors.txt file?

-->diff colours.txt devops.txt

Thanks for giving your valuable time.

Lets Connect