LESSON 1: BASIC COMMAND LINES
Tags: webdev, beginners, tutorial, html
Published: 2022-04-27 13:50:52

## **NB:**

-  Almost Everything is done on the keyboard and therefore keyboard shortcuts are your new best friends. e.g.- CTRL+C/CTRL+V (COPY/PASTE),you can't highlight text and right click for copy.


_Alright, rub your hands in glee....You're about to look a little cooler to your friends,family and colleagues._

 
**Open your Terminal**

-I recommend you get [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-ke&gl=KE) Or use Command Prompt/PowerShell

**Why Windows Terminal?**

- You can have multiple Tabs open.

- You can custom-style it

- Supports multiple command-line tools and shells like Command 
   Prompt, PowerShell, and WSL.


![wndows_terminal_clara_situma_class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8b0265t165mxyxmatsm.JPG)


## 1. Changing Directory(cd)

-You will use this command Often to navigate through directories.

for example:
I just opened my windows Terminal on the example above.
Now I'd like to get into the Documents Directory:

```
cd Documents
```


![terminal_clara_situma_lesson](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drklt9ihu3yuq9aw7p16.JPG)

_and Just like that I'm on the Documents Directory!!_

**To head back to the previous directory or go one level up of the current directory, type:**

```

cd ..
```

![terminal_cd_directory_clara_situma_lessons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqhkjb5r71g9xggnqy82.JPG)

_and we are BACK! to the previous Directory_!!



## 2.Creating a New Folder (MKDIR)
-This command is one that you will use as often as (cd)...it's called **MKDIR**. 

- It creates a new directory with the specified name. 

e.g- 
The following command will create a new Folder named Newbie:

```
mkdir Newbie
```


![mkdir_newfolder_clara_situma_lesons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uznl3jczh9hdmw0d3ps0.JPG)

_and Sure enough, if you go to Documents Directory...You'll see a folder named Newbie_

--Suported by both Powershell and Command Prompt

**Creating Multiple Folders**:

If you want to create Multiple folders, for example:
One called Ciku, Another Simo, and another one called Mato:

```
mkdir Ciku Simo Mato 
```
will create those 3 folders on _the Command prompt_

--PowerShell may not support this.


## 3. Creating New File(touch)
Use the **touch** command to create an empty file. 

For example:


`touch newfile.html`

will create a file called newfile.html


**create multiple files at once.**

Works the same as creating multiple folders. Space between the names

```
touch anotherfile.html style.css
```


Alright so these 3 commands are just the Basics, to learn more about Command Lines...Read [this ](https://www.hongkiat.com/blog/web-designers-essential-command-lines/)article

##4. BONUS - TO OPEN FOLDER/FILE WITH VISUAL STUDIO CODE

To open your folder or file with VScode, you simply write:

`code .` Inside the desired Folder (Notice the space between code and the fullstop)


![openwith_visual_stuudio_code_calara_situma_lessons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyvipqtyzhi18vfd2ys5.JPG)


**Practical Practice:**

On your Terminal, Create a Folder in the Documents Terminal, create a html file inside your new folder, open your new folder in VSCode...Happy Coding!!