# Basic Linux Commands

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705946412763/1a11b4b0-ee9d-4be0-be68-4115fd89e08f.jpeg align="center")

---

### **Task: What is the Linux command??**

---

  
The term "Linux command" refers to a command-line instruction or a series of commands used in a Linux operating system. Linux is a Unix-like operating system, and one of its strengths lies in its command-line interface, where users can interact with the system by typing commands.

Linux commands are entered in a terminal or shell, and they perform various tasks such as file manipulation, process management, system configuration, and more. These commands are case-sensitive and often consist of a command name followed by options and arguments.

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