Basic Linux Commands-2

  1. cat {filename} - used to view what's written in a file.

  2. chmod {filename} - used to change the access permissions of files.

  3. history - to check which commands you have run till now

  4. rmdir directory/ - removes the directory/ folder.

  5. touch fruits.txt cat fruits.txt- create a file called fruits.txt and view it

  6. touch devops.txt > Apple, Mango, Banana, Cheery, Kiwi, Orange, Purple, Grey.-creates a filename called devops.txt and adds the contents.

  7. head -n 3 fruits.txt - to Show only the top three fruits from the file.

  8. tail -n 3 fruits.txt - to Show only the bottom three fruits from the file.

  9. touch colors.txt and cat colors.txt - to create a file called colors.txt and to view it.

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

  11. diff fruits.txt Colors.txt - To find the difference between fruits.txt and Colors.txt files.