# Day 3 -  Basics Linux command

**Task: What is the Linux command to**

1. **To view what's written in a file.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707235749861/364de897-6be6-4d5f-b363-a32377639230.png align="center")
    
    We use the **cat** command to view the content of the file
    
2. **To change the access permissions of files.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707235988273/e8c834b2-58d8-4e5e-9cb8-b7e9736e3e90.png align="center")
    
    For changing the permission of the file we use **chmod** command
    
3. **To change the access permissions of files.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707236356011/747a24d5-847f-4909-9a5a-d87806035ac2.png align="center")
    
    **history** command is used to display the history of the commands executed by the user
    
4. **To remove a directory/ Folder.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707236558539/5f058f57-361a-4c42-ab69-0656958190d4.png align="center")
    
    To remove any file and folder in Linux, we used the **rm** command. The -r flag stands for Recursive i.e. in simple words it will delete the files first and then the folder.
    
5. **To create a fruits.txt file and to view the content.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707237218577/799aae6c-8106-41b4-9fa3-76163a42c045.png align="center")
    
    We use the **touch** command to create the file, To add the content in a file, we have used the **vim** command, cat command is used to see the file content.
    
6. **Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707237725704/e41a708a-c2db-4393-8528-a97bbb39425c.png align="center")
    
7. **To show only the top three fruits from the file.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707237862866/31886804-aeb1-4dcd-8c0f-95a71767651e.png align="center")
    
8. **To Show only the bottom three fruits from the file.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707237954347/53b9e4f5-9940-411a-920e-dc731c13fd18.png align="center")
    
9. **To create another file Colors.txt and to view the content.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707238265848/3272a3f0-6698-4da8-88e7-ce085a26f0ca.png align="center")
    
10. **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/v1707238379723/f39b421f-2e9f-4898-8866-45c1fccdac22.png align="center")
    
11. **To find the difference between fruits.txt and Colors.txt file.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1707238525878/fcfabfef-c93f-4da6-9f90-9c1e5cb8f70c.png align="center")
    
    Thank you for reading! :)
