# Day: 02 Basics Linux Command..!!

### **Overview of Linux**

Linux® is an [open-source](https://www.redhat.com/en/topics/open-source/what-is-open-source) operating system (OS). An [operating system](https://www.redhat.com/en/technologies/linux-platforms/old-enterprise-linux) is a software that directly manages a system’s hardware and resources, like CPU, memory, and [storage](https://www.redhat.com/en/topics/data-storage/software-defined-storage). The OS sits between applications and hardware and makes the connections between all of your software and the physical resources that do the work.

### **Directory Structure**

In Linux everything is represented as a file including a hardware program, the files are stored in a directory, and every directory contains a file with a tree structure. That is called File System Hierarchy.

Linux uses a single-rooted, inverted tree-like structure.

Root Directory represents with / (forward slash) It is a top-level directory in RHEL & all Linux.

### **File System Hierarchy**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681899595939/f608a6b1-0f87-4b4c-b21f-a4338165048b.png align="center")

### **Basic Linux Commands !!**

`ls` &gt; List all directories/files.

`ls -a` -&gt; List all files along with hidden files.

`ls -la` --&gt; command provides a detailed listing of all files and directories in the current directory.

`ls -R` -&gt; shows all files in a subdirectory.

`ls *.sh` --&gt; lists all the files having .sh extension.

`ls -i` --&gt; List the files and directories with index numbers Inodes.

`ls -d */` --&gt; List only directories. (we can also specify a pattern).

`cd` -&gt;for changing the directory.

`cat` It can be used to create a file, display the content of the file, copy the content of one file to another file, and more.

`touch` -&gt; for creating empty files.

`mkdir` -&gt; to make a new directory.

`cp` -&gt; To copy files.

`mv` -&gt; to move files around.

`rm` -&gt; to remove files.

**Task for day-02**

1. Check your present working directory.
    
2. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682358500313/1e1f18da-b9ab-456f-ac6f-5efe1d83c7ae.png align="left")
    
    List all the files or directories including hidden files.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682358713208/64114eb3-ba4a-41e9-9f9e-28f171fec327.png align="center")
    
3. Create a nested directory A/B/C/D/E .
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1682359033893/7c318472-ead6-46e4-9407-776d7a1cf57f.png align="center")
    
4. **To check memory, will use 3 commands:**
    
    <table><tbody><tr><td colspan="1" rowspan="1"><p>RAM</p></td><td colspan="1" rowspan="1"><p>&nbsp; --&gt; free</p></td></tr><tr><td colspan="1" rowspan="1"><p>Disk&nbsp;</p></td><td colspan="1" rowspan="1"><p>--&gt; df -H&nbsp;&nbsp;&nbsp;</p></td></tr><tr><td colspan="1" rowspan="1"><p>CPU&nbsp;</p></td><td colspan="1" rowspan="1"><p>--&gt; top</p></td></tr></tbody></table>
    

*Thanks for reading this article...*

*Keep Learning.!!*
