# Linux Commands

### **<mark>What is Linux command to-</mark>**

### [**<mark>1.To</mark>**](http://1.To) **<mark> view what's written in a file-cat filename</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680117349230/534638b6-ce43-489c-aa3d-51d1903aeebe.png?auto=compress,format&format=webp align="left")

### [**<mark>2.To</mark>**](http://2.To) **<mark> change the access permissions of files.</mark>**

chmod- To provide required permissions.

e.g.-chmod 777-READ WRITE EXECUTE for All

**r** = read permission  
**w** = write permission  
**x** = execute permission  
**–** = no permission

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680117504967/e629e55d-de31-4bdc-97d3-b687ebc4ce7b.png?auto=compress,format&format=webp align="left")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687374922896/720cbfd9-9b36-490a-b9ef-4d069b91ab9d.avif align="center")

### [**<mark>3.To</mark>**](http://3.To) **<mark> check the history</mark>**

"history"

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118057678/065cb46a-e75b-465f-85fc-2784215683ea.png?auto=compress,format&format=webp align="left")

### [**<mark>4.To</mark>**](http://4.To) **<mark> remove directory/folder</mark>**

rm -rf/rm (r===recursively)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118238137/7ecc0cc6-5592-4ae5-a6c7-d439055916e2.png?auto=compress,format&format=webp align="left")

### [**<mark>5.To</mark>**](http://5.To) **<mark> create fruits.txt file and to view the content</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118418049/3dff544a-3d6c-413a-a5b3-f32e1438cad4.png?auto=compress,format&format=webp align="left")

### **<mark>6.Add contents in devops.txt(1 in each line)-apple,mango,banana,cherry,kiwi,orange,guava</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118594031/f4da40f9-cade-4183-af08-6de618948135.png?auto=compress,format&format=webp align="left")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118659736/b4d10007-4740-401e-8c68-8f6c5a48f829.png?auto=compress,format&format=webp align="left")

### [**<mark>7.To</mark>**](http://7.To) **<mark> show only top3 fruits from the file</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118723839/04e48447-3e7f-43c4-bbd3-d5ad6b890160.png?auto=compress,format&format=webp align="left")

### [**<mark>8.To</mark>**](http://8.To) **<mark> show only bottom3 fruits from the file.</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680118963772/9ee81d1c-2c01-4746-8d22-aec51e873c8f.png?auto=compress,format&format=webp align="left")

### [**<mark>9.To</mark>**](http://9.To) **<mark> create another files colors.txt and to view the content</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680119144806/794ce90d-90cd-4bd8-b21d-07041cf13258.png?auto=compress,format&format=webp align="left")

### **<mark>10.Add contents in Colors.txt</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680119163441/8a6a6f82-7625-4dbc-9ee3-8ca14985e0c6.png?auto=compress,format&format=webp align="left")

### [**<mark>11.To</mark>**](http://11.To) **<mark> find the difference between fruits.txt nd colors.txt</mark>**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1680119287475/47909b2d-ff2a-441c-9f0f-b076e47ecc79.png?auto=compress,format&format=webp align="left")
