Day 3- Basic Linux Commands

Day 3- Basic Linux Commands

Commands:

  1. View the content of a file (cat):

     shellCopy code$ cat file.txt
    
  2. Change the access permissions of files (chmod):

     shellCopy code$ chmod permissions filename
    
  3. Check the command history (history):

     shellCopy code$ history
    
  4. Remove a directory/folder (rmdir):

     shellCopy code$ rmdir folder_name
    
  5. Create a file and view the content (touch and cat):

     shellCopy code$ touch fruits.txt
     $ cat fruits.txt
    
  6. Add content to devops.txt (echo and redirect):

     swiftCopy code$ echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt
    
  7. Show only the top three fruits (head):

     shellCopy code$ head -n 3 devops.txt
    
  8. Show only the bottom three fruits (tail):

     shellCopy code$ tail -n 3 devops.txt
    
  9. Create another file Colors.txt and view the content (touch and cat):

     shellCopy code$ touch Colors.txt
     $ cat Colors.txt
    
  10. Add content to Colors.txt (echo and redirect):

    swiftCopy code$ echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt
    
  11. Find the difference between fruits.txt and Colors.txt file (diff):

    rubyCopy code$ diff fruits.txt Colors.txt