# Linux commands

1. To view what's written in a file:
    
    ```plaintext
    bashCopy codecat filename
    ```
    
2. To change the access permissions of files:
    
    ```plaintext
    bashCopy codechmod permissions filename
    ```
    
3. To check which commands you have run till now:
    
    ```plaintext
    bashCopy codehistory
    ```
    
4. To remove a directory/Folder:
    
    ```plaintext
    bashCopy coderm -r directoryname
    ```
    
5. To create a fruits.txt file and view the content:
    
    ```plaintext
    bashCopy codetouch fruits.txt
    cat fruits.txt
    ```
    
6. To add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava:
    
    ```plaintext
    swiftCopy codeecho -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt
    ```
    
7. To show only the top three fruits from the file:
    
    ```plaintext
    bashCopy codehead -n 3 devops.txt
    ```
    
8. To show only the bottom three fruits from the file:
    
    ```plaintext
    bashCopy codetail -n 3 devops.txt
    ```
    
9. To create another file Colors.txt and view the content:
    
    ```plaintext
    bashCopy codetouch Colors.txt
    cat Colors.txt
    ```
    
10. To add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey:
    
    ```plaintext
    swiftCopy codeecho -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt
    ```
    
11. To find the difference between fruits.txt and Colors.txt file:
    
    ```plaintext
    Copy codediff fruits.txt Colors.txt
    ```
