Linux commands for DevOps (Commands used in day-to-day activities).

Linux commands for DevOps (Commands used in day-to-day activities).

Hello Everyone,
#day3
Basics Linux command
As a challenge #90daysofdevops under Shubham Londhe
#devops #90daysofdevops #trainwithshubham #awscloud

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

    The cat command is used to display the contents of a file on the terminal. For example, to view the contents of a file named hello.txt, run the following command:

To change the access permissions of files.

  1. The chmod command is used to change the access permissions of files. For example, to give the owner of a file read, write, and execute permissions and everyone else only read and execute permissions, run the following command:

To check which commands you have run till now.

  1. The history command is used to show a list of all the commands you have run in the current terminal session. For example:

To remove a directory/ Folder.

  1. The rmdir -r command is used to remove an empty directory or folder. For example, to remove a directory named Linux, run the following command:

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

  1. The touch command is used to create a new file. For example, to create a file named fruits.txt, run the following command.

    You can use the cat command to view the contents of the newly created file:

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

      The vim command is used to add content to a file. For example, to add the words "Apple", "Mango", "Banana", "Cherry", "Kiwi", "Orange", and "Guava" to the file named devops.txt, one on each line, run the following commands:

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

        The head command is used to display the first few lines of a file. For example, to show only the top three fruits from the devops.txt file, run the following command:

      2. To Show only Bottom three fruits from the file.

        The tail command is used to display the last few lines of a file. For example, to show only the bottom three fruits from the devops.txt file, run the following command:

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

    You can create another file named Colors.txt using the touch command:

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

    To view the contents of the newly created file, use the cat command:

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

    use diff command to difference between two files.