# Linux  Basic Commands

If you're new to Linux, using the terminal to manage folders, files, and software might seem hard at first. But with a few basic commands, it becomes easy and powerful.

In this guide, we will show you simple Linux commands to help you create folders, view files, edit documents, and more. These steps are great for beginners or anyone looking to learn how to use Linux in a simple way.

---

### Make a Directory or Folder

* `mkdir myFolder`
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115314600/093a28ab-1487-4327-b86d-57c3b9c3cb7d.png align="center")

---

### **View directory contents**:

* `ls`: Lists all files and directories in the current directory.
    
* Example: `ls /home` shows files in the `/home` directory.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115424973/e8ab19ae-5cb1-40bf-86f4-32d1b91999fd.png align="center")

---

### **Change directory**:

* `cd <directory_path>`: Changes to a different directory.
    
* Example: `cd /home/user/Documents` moves you to the Documents directory.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115465222/b5808570-f112-4004-b8eb-a3a0cf34aedd.png align="center")
    

---

### **Create a file**:

\* `touch filename`: Creates an empty file.

\* Example: `touch myfile.txt` creates an empty file called `myfile.txt`.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115496476/e5f9efb4-1773-4cf0-90d3-de67695c391f.png align="center")

---

### **Edit a file**:

* `nano filename`: Opens a file in the `nano` text editor.
    
* Example: `nano myfile.txt` lets you edit `myfile.txt`.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115669996/7b06ed66-15d3-4580-b3ed-e84c35199d69.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115806109/975a637a-98bd-42ef-86a0-ac907700f4f3.png align="center")

click ctrl + O to save

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115822737/b06e0d14-73f2-4e5e-8383-ec8909a00145.png align="center")

* Press **Enter** to confirm the file name and save.
    
* To exit Nano after saving, press `Ctrl + X`.
    

---

### **Delete a file**:

\* `rm filename`: Deletes a file.

\* Example: `rm myfile.txt` deletes `myfile.txt`.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726115913447/8db94e07-2f8c-4aac-bb52-608a5067b7b7.png align="center")

---

### **Install software**

(on Ubuntu/Debian-based systems):

\* `sudo apt install <package_name>`: Installs a program.

\* Example: `sudo apt install git` installs Git or `sudo yum install git`. please refer to this [https://software-engineer.thirdygayares.com/package-manager-in-linux](https://software-engineer.thirdygayares.com/package-manager-in-linux)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726116109568/6141f1c7-dc5f-4877-b072-88601aab39a9.png align="center")

---

### To check storage usage and available space in Linux, you can use the following command:

\* `df -h`: Displays disk space usage in a human-readable format (GB, MB, etc.).

Example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1726116140548/bcb5cc4d-11d9-4fe7-be68-37503330f05d.png align="center")
