# Basic Linux Commands

* `ls` --&gt; The ls command is used to list files or directories in Linux and other Unix-based operating systems.
    

![ls](https://user-images.githubusercontent.com/76457594/210222403-35776fbc-e509-4c9c-a0ad-e5975599ffab.png align="left")

* `ls -l`\--&gt; Type the ls -l command to list the contents of the directory in a table format with columns including.
    
    \- content permissions - number of links to the content - owner of the content - group owner of the content - size of the content in bytes - last modified date / time of the content - file or directory name
    

![Uploading ls -l.png…]( align="left")

* `ls -a` \--&gt; Type the ls -a command to list files or directories including hidden files or directories. In Linux, anything that begins with a . is considered a hidden file.
    

![ls -a](https://user-images.githubusercontent.com/76457594/210223013-9353abf0-159c-4797-a19f-3b78a8d4ef00.png align="left")

* `ls *.sh` --&gt;
    

![ls * sh](https://user-images.githubusercontent.com/76457594/210223067-f5c3a5bf-09b4-4525-90e7-9ce61186ae2e.png align="left")

* `ls -i` \--&gt; List the files and directories with index numbers in oders
    

![ls-i](https://user-images.githubusercontent.com/76457594/210225502-946551c7-fd81-402b-b8ce-091792e24c44.png align="left")

* `ls -d */` --&gt; Type the ls -d \*/ command to list only directories.
    

![ls-d*](https://user-images.githubusercontent.com/76457594/210223178-f7097a96-31b1-4c98-8b81-2e5b0e3a7bb7.png align="left")

## Directory commands

* `pwd` --&gt; Print work directory. Gives the present working directory.
    

![pwd](https://user-images.githubusercontent.com/76457594/210223234-e5f3a48c-1b08-4bce-943e-4fed50a12700.png align="left")

* `cd path_to_directory` --&gt; Change directory to the provided path.
    

![cd](https://user-images.githubusercontent.com/76457594/210223291-355b8eb1-d1b5-41a4-a1b3-07fe7d786794.png align="left")

* `cd ~` or just `cd` \--&gt; Change directory to the home directory.
    

![cd ~](https://user-images.githubusercontent.com/76457594/210223377-845975d3-344d-49d3-946e-05f2d2170ac4.png align="left")

* `cd -` --&gt; Go to the last working directory.
    

![cd -](https://user-images.githubusercontent.com/76457594/210223414-d6333b9c-21cb-4053-abb9-871bbca5db08.png align="left")

* `cd ..` --&gt; Chnage directory to one step back.
    

![cd](https://user-images.githubusercontent.com/76457594/210223531-956598ad-301c-486a-b02e-6e69c4104adb.png align="left")

* `cd ../..` --&gt; Use ls ../.. for contents two levels above.
    

![cd  bs](https://user-images.githubusercontent.com/76457594/210223634-2f37f616-5857-4f31-a9a6-796b0f0ab1e5.png align="left")

* `mkdir directoryName` --&gt; Use to make a directory in a specific location
    

![mkdir  ](https://user-images.githubusercontent.com/76457594/210224037-9ba396ad-77a8-48d4-8d28-2fa513c2b06a.png align="left")

* `mkdir .NewFolder` --&gt; Make a hidden directory (also . before a file to make it hidden)
    

![mkdir  ](https://user-images.githubusercontent.com/76457594/210224230-89db3d98-f04a-4edd-998f-0f9a0219f06e.png align="left")

* `mkdir A B C D` \--&gt; Make multiple directories at the same time.
    

![mkdir A B C](https://user-images.githubusercontent.com/76457594/210224267-6d14de9a-2c05-4ea9-853f-ddb44dda8f23.png align="left")

* `mkdir /home/user/Mydirectory` \--&gt; make a new folder in a specific location
    

![mkdir inside](https://user-images.githubusercontent.com/76457594/210224331-dc7a2916-a64c-40ed-8951-7e2677df4957.png align="left")

* `mkdir -p A/B/C/D` \--&gt; Make a nested directory
    

![mkdir-p](https://user-images.githubusercontent.com/76457594/210224365-78ec406e-0a2e-4666-a30d-ac406f0dd695.png align="left")
