Windows command prompt basics | Cyber Security Tutorial - Learn with VOKS
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Back Next

Windows command prompt basics

Learn this topic step-by-step with VOKS Tutorials.

What Is Command Prompt?

Command Prompt (often called cmd) is a text-based program in Windows that lets you control your computer by typing commands instead of clicking with a mouse.

Instead of:

  • Clicking folders
  • Using buttons
  • Navigating menus

You type instructions directly to the operating system.

It is also called a Command-Line Interface (CLI).

How to Open Command Prompt

Method 1:

  1. Press Windows key + R
  2. Type cmd
  3. Press Enter

Method 2:

  1. Click Start
  2. Type "Command Prompt"
  3. Click it

You’ll see something like:

C:\Users\YourName>

This is called the prompt. It shows your current location (directory).

Understanding Directories (Folders)

In Command Prompt:

  • Folders are called directories
  • Files are inside directories
  • Everything starts from a drive like C:\

Example path:

C:\Users\John\Documents>

This means:

  • You are in the Documents folder
  • Inside John’s user folder
  • On the C drive

Basic Navigation Commands

Show Files and Folders

dir

This lists everything in the current directory.

Change Directory

cd foldername

Example:

cd Documents

Go back one level:

cd ..

Go to root of drive:

cd \

Creating and Deleting Things

Create a Folder

mkdir MyFolder

or

md MyFolder

Delete a Folder

rmdir MyFolder

If the folder has files inside:

rmdir /s MyFolder

Create a File

type nul > file.txt

Delete a File

del file.txt

Viewing File Contents

type file.txt

This prints the file’s content to the screen.

Clearing the Screen

cls

This clears everything from the screen.

Running Programs

You can run programs by typing their name.

Example:

notepad

You can also run executable files:

program.exe

If the program is not in the current folder, you must give the full path:

"C:\Program Files\App\program.exe"

Getting Help

To see available commands:

help

To get help for a specific command:

help dir

Important Concepts

1. Case Sensitivity

Windows Command Prompt is NOT case-sensitive.

These are the same:

DIR
dir
Dir

2. Paths

There are two types of paths:

Absolute path:

C:\Users\John\Documents

Relative path:

Documents

Absolute starts from drive root.

Relative starts from current location.

3. Command Syntax Structure

Most commands follow this pattern:

command option target

Example:

rmdir /s MyFolder
  • command = rmdir
  • option = /s
  • target = MyFolder

Simple Practice Session

Example session:

dir
mkdir TestFolder
cd TestFolder
type nul > hello.txt
dir
type hello.txt
cd ..
rmdir /s TestFolder
cls

What this does:

  1. Lists files
  2. Creates folder
  3. Enters folder
  4. Creates file
  5. Lists contents
  6. Shows file content
  7. Goes back
  8. Deletes folder
  9. Clears screen


dir

cd foldername
cd ..
cd \

mkdir MyFolder
md MyFolder

rmdir MyFolder
rmdir /s MyFolder

type nul > file.txt
del file.txt

type file.txt

cls

notepad
program.exe
"C:\Program Files\App\program.exe"

help
help dir

dir
mkdir TestFolder
cd TestFolder
type nul > hello.txt
dir
type hello.txt
cd ..
rmdir /s TestFolder
cls
QUICK KNOWLEDGE CHECK

Test Your Understanding

Answer 5 questions generated from this lesson. Your result is calculated instantly and is not saved.

0 / 5 answered
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Course contents
Cyber Security
01 Introduction 02 Types of Cyber Threats 03 Cyber Security Domains 04 CIA Triad (Confidentiality Integrity Availability) 05 Career paths in Cyber Security 06 Certifications 07 Ethics and Responsible Disclosure 08 Laws and Regulation (e.g. GDPR, NDPR) 09 What is an OS? 10 Types: Window, Linus, macOS 11 Command-line vs GUI 12 OS Internals Overview (filesystems, processes, permissions) 13 Windows command prompt basics 14 Linux Bash Basics 15 File System Navigation 16 Basic Scripting 17 IP Addressing 18 DNS, DHCP 19 Mac Address 20 OSI VS TCP/IP Models 21 Ports and Protocols (TCP, UDP) 22 Common Protocols (HTTPS, FTP, SSH, etc.) 23 Packet structure 24 Firewalls, IDS/IPS, VPNs 25 Common attacks: MITM, Sniffing 26 Secure Network Practices 27 How the Web works 28 HTTP vs HTTPS 29 URLs, Headers, Cookies 30 Client-Server Architecture 31 Introduction To Web Security 32 OWASP Top 10 Overview 33 Common Threats (XSS, SQLi, CSRF) 34 Inpute validation and authentication flow 35 Basic Exploitation demo (e.g. XSS) 36 Burp Suite Introduction 37 Using a Browser For Testing 38 Password security 39 MFA-Antivirus 40 Cyber Hygeine Practice 41 Intro To Tools: Nmap, Wireshark, Netstat