# Day3: Linux Commands.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676356332558/b9b8f893-eb66-4b29-b500-fda232d74c6b.png align="center")

### **To view what's written in file:**

***cat*** is used to show the content of the file on the terminal.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676357819039/ddea27c8-0691-40d3-bd3c-16106a9647b6.png align="center")

***chmod*** is used to change the access permissions of files in a directory.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676357837946/bf858ac9-370d-4be5-9df2-d3309ec21237.png align="center")

***history*** is used to check which commands you have run till now.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676357855918/fcdb53b5-9a5c-4578-82bf-2b3e258dbea9.png align="center")

rm -rf &lt;filename&gt; is used to remove the directory.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676357881714/dfe2118f-6da2-4396-8928-acd8d6f4110d.png align="center")

touch fruits.txt is used to create the file. to view the content we can use vi fruits.txt.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676357955943/ac49fba1-2927-42a9-8933-182d8bd9a27a.png align="center")

to show only top three fruits, we use head -3 fruits.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676357979146/495edcf4-d0f7-44c8-be5c-4598851ff68a.png align="center")

to show the bottom three fruits' names. we use tail -3 fruits.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676358002380/5e66511e-5330-4e43-91cf-7cde0cb24d6f.png align="center")

To find the difference between the fruits.txt and colors.txt. we use diff command.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676358026259/211cda17-7b72-4c49-a7fd-5a73a361b0e1.png align="center")
