DEV Community

Cover image for LESSON 1: BASIC COMMAND LINES
Clara Situma
Clara Situma

Posted on • Edited on

LESSON 1: BASIC COMMAND LINES

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 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

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
Enter fullscreen mode Exit fullscreen mode

terminal_clara_situma_lesson

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 ..
Enter fullscreen mode Exit fullscreen mode

terminal_cd_directory_clara_situma_lessons

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
Enter fullscreen mode Exit fullscreen mode

mkdir_newfolder_clara_situma_lesons

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 
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Alright so these 3 commands are just the Basics, to learn more about Command Lines...Read this 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

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!!

Top comments (0)