# Linux-Part-2

Hello connection,

Today I have completed ✍ my Day:03 blog based on basic Linux commands part-2.  
please have a look 😊😊  
like and share your valuable feedback. 👇

Day 3 Task: Basic Linux Commands

Task: What is the Linux command to

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

#cat file1

1. To change the access permissions of files.
    

#chmod

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

#history

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679770268342/33e1cb33-f47b-40d8-9923-b22ad6cd632d.png align="center")

1. To remove a directory/ Folder.
    

#rmdir

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

#touch fruits.txt

#cat fruits.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679770410001/107be3da-c70f-4c1c-aefb-28c6c0b3c515.png align="center")

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

#cat &gt; devops.txt

\# cat devops.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679770449709/e0fe3952-622a-46b4-a1a7-a6c5948063a2.png align="center")

7.To Show only top three fruits from the file.

#head -3 devops.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679770490539/e9420e87-21cd-49e6-a9a9-838538430894.png align="center")

8.To Show only bottom three fruits from the file.

#tail -3 devops.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679770519651/eb86ba08-dca2-4397-a458-0e2a0cb4b892.png align="center")

9.To create another file Colors.txt and to view the content.

\# touch Colors.txt

#vi Colors.txt (insert content press I button as add data, then save :wq!)

#cat Colors.txt

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/v1679770562079/66222c88-4de6-46e4-a8e9-dc1654fc2c7e.png align="center")

11.To find the difference between fruits.txt and Colors.txt file.

\# diff Colors.txt devops.txt

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
