# Day 3 : Basic Linux commands

This is **#90DaysofDevops** challenge under the guidance of [ShubhamLondhe](https://www.linkedin.com/in/shubhamlondhe1996/) sir

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

“cat filename”

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812265526/860431e5-d41a-4dc2-9a98-47bdcdfdffbc.png align="center")

1. **To change the access permissions of files.**
    

“chmod 777 foldername”

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812281906/56e69e7f-96b7-4fee-b05d-100dc3147a82.png align="center")

1. **To check which commands you have run till now.**
    

“history”

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812295794/2b09d655-ffe5-4d0b-b9fa-ab5e5799774d.png align="center")

1. **To remove a directory/ Folder.**
    
    “rm filename” -&gt; to remove the file
    
    “rmdir foldername” -&gt; to remove folder
    
    “rm –r foldername” -&gt; to remove folder recursively
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812339556/815d7307-b17c-4469-89df-dfc51676062d.png align="center")

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

“vim fruit.txt”

“cat fruit.txt”

Save and exit: If you want to save your changes and exit Vim, you can use the **:wq command**. 

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812399906/86797dba-d0a9-4252-bd56-f9b224cea535.png align="center")

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

Use command “vim devops.txt” and add the fruit one by one

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812422143/b8d4d10f-ac7c-4215-9f62-0b105dd8bcd7.png align="center")

1. **To Show only top three fruits from the file.**
    

“cat devops.txt | head -3” is used to show only top 3 fruit from file.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812448303/fb8aea01-3aaa-4371-8266-04683374c5b5.png align="center")

1. **To Show only bottom three fruits from the file.**
    
    “cat devops.txt | tail -3” is used to show only top 3 fruit from file.
    
2. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812473023/7fcb7e75-b89f-425a-acc2-436362001761.png align="center")
    

1. **To create another file Colors.txt and to view the content.**
    
    Use the command “vim color.txt” to create new file and add color name one by one
    
2. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679812561302/92dbd79b-7ccb-4906-aae1-8292fa81e12b.png align="center")
    
    **To find the difference between devops.txt and Colors.txt files.**
    
    “diff devops.txt color.txt” this command is used to find the difference between two files.
