# Day 3 - Basic Linux Commands with a Twist

### 1) View the content of a file and display line numbers.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536442906/3d586f60-8728-460b-9c41-38fe2c91de32.png align="center")

### 2) Change the access permissions of files to make them readable, writable, and executable by the owner only.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748537104424/f04714c5-fb43-485d-8071-d07fbfa36ce0.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536476321/61f687e0-3b9b-4d15-ba5b-28b431f8622d.png align="center")

### 3) Check the last 10 commands you have run.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536495612/1a0c87b1-9501-4386-93c2-d344562c6e2b.png align="center")

### 4) Remove a directory and all its contents.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536517029/ba4c95bb-4f88-4a60-9397-16d3c7cc0d66.png align="center")

### 5) Create a `fruits.txt` file, add content (one fruit per line), and display the content.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536545327/8afd1205-cb29-46df-a376-1d0a343b9390.png align="center")

### 6) Add content in `devops.txt` (one in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava. Then, append "Pineapple" to the end of the file.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536722143/cd454d07-e7f1-4fbe-9855-06103cf0c0f5.png align="center")

### 7) Show the first three fruits from the file in reverse order.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536742791/06d067bc-8b28-42eb-8872-d86aec28081e.png align="center")

### 8) Show the bottom three fruits from the file, and then sort them alphabetically.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536770948/3d241201-ef49-4c9c-ad01-ae5bc8c9b706.png align="center")

### 9) Create another file `Colors.txt`, add content (one color per line), and display the content.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536854598/ae33337f-a09b-4ad5-b27f-53305a1038c9.png align="center")

### 10) Add content in `Colors.txt` (one in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey. Then, prepend "Yellow" to the beginning of the file.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536886041/f345102d-76db-43db-a235-6e23e897c401.png align="center")

### 11) Find and display the lines that are common between `fruits.txt` and `Colors.txt`.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536916638/9210219c-d162-4e54-9ae9-fd16ad373374.png align="center")

### 12) Count the number of lines, words, and characters in both `fruits.txt` and `Colors.txt`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748536931390/6d9f3f79-5d64-4086-aa67-6ccdeacc48d1.png align="center")
