Day 3 : Hands-on Linux

·

1 min read

Task: What is the Linux command to

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

     cat <file_name>
    
  2. To change the access permissions of files.

     chmod <permissions> <file_name>
    
  3. To check which commands you have run till now.

     history
    
  4. To remove a directory/ Folder.

     rmdir <directory_name>
    
  5. To create a fruits.txt file and to view the content.

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

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

     head -3 devops.txt
    
  8. To Show only the bottom three fruits from the file.

     tail -3 devops.txt
    
  9. To create another file Colors.txt and to view the content.

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

    shown in the above image

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

    diff fruits.txt Colors.txt
    

    Thank you for reading till the end See you in the next one.