# Master the Linux Terminal: Top 10 Most Essential Commands to Know

### ls: list directory contents

The `ls` command in Linux is used to list the contents of a directory. It stands for **list** and is one of the most commonly used commands in the Linux terminal.

Some of the basic options that can be used with `ls` include:

* `-l` : This option displays the contents of a directory in a long format, showing details such as permissions, owner, size, and modification date for each file or directory.
    
* `-a` : This option displays all files and directories, including hidden files.
    
* `*` : This option lists the contents of the directory with its subdirectories.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675496854187/b89ad4a5-36d5-46e4-9f2c-dac5f58fa478.gif align="center")

### cd: change directory

The `cd` command in Linux is used to change the current working directory. It stands for **change directory** and is used to navigate the file system.

Some examples of using the `cd` command include:

* `cd /` : This changes the current working directory to the root directory.
    
* `cd ~/` : This changes the current working directory to the home directory of the current user.
    
* `cd ../` : This changes the current working directory to the parent directory.
    
* `cd <directory>` : This changes the current working directory to the specified directory, relative to the current working directory.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675497588151/78cd5553-4aba-494c-83a0-6d722def7f53.gif align="center")

### pwd: print working directory

The `pwd` command in Linux stands for **print working directory** and is used to display the current working directory.

When you run the `pwd` command, the full path of the current working directory is displayed on the terminal. This is useful for determining your current location in the file system and for referencing other files and directories relative to the current working directory.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675497788304/e3e6e25c-c62f-4784-b16a-62ef46c1e529.gif align="center")

### cp: copy files and directories

The `cp` command in Linux is used to copy files and directories from one location to another.

The most common options used with `cp` are:

* `-v` : This option displays the progress of the copy operation.
    
* `-R` : This option is used to copy directories recursively, including all files and subdirectories within them.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675751033845/773c5dc6-7f47-4105-b1f6-4d41f079750c.gif align="center")

### rm: remove files and directories

The `rm` command in Linux is used to remove files and directories.

The most common options used with `rm` are:

* `-r` : This option is used to remove directories and their contents recursively.
    
* `-v` : This option displays the name of each file as it is removed.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675751321948/16af19a4-2875-4b86-a8b1-250de3560432.gif align="center")

### mv: move or rename files and directories

The `mv` command in Linux is used to move files and directories from one location to another.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678026088261/f0f34506-8b1f-421f-b90d-20634447fb99.gif align="center")

### touch: create a new file

The `touch` command in Linux is used to create new empty files.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678026275226/02f525e2-61d4-4db6-82d1-45c02f46720e.gif align="center")

### mkdir: make a new directory

The `mkdir` command in Linux is used to create new directories.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678026451996/ea959a28-e464-490c-b854-5241ef94c18c.gif align="center")

### echo: display a message or the value of a variable

The `echo` command in Linux is used to display text or the contents of variables on the screen.

The most common options used with `echo` is:

* `-e` : This option enables the interpretation of backslash escapes.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678027333965/42d636c4-d388-43b0-9538-0c8d2a75d981.gif align="center")

### cat: concatenate and display the contents of files

The `cat` command in Linux is used to concatenate and display the contents of files on the screen.

The most common options used with `cat` are:

* `-n` : This option displays the line numbers for each line of the file.
    
* `-b` : This option displays the line numbers only for non-empty lines of the file.
    
* `-e` : This option displays a `$` character at the end of each line of the file.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678028062001/910406a1-85f1-4978-8e03-59443b5e7861.gif align="center")
