By the end of this lesson you will be able to
- Explain the difference between Windows Terminal, Command Prompt and PowerShell.
- Open a terminal on Windows 11 and read its prompt.
- Move between folders and list their contents in both PowerShell and Command Prompt.
- Create a practice folder and a file inside it using safe commands.
- Match common PowerShell commands to their Linux equivalents.
Windows has a command line too, and it is very useful: IT staff use it to check a network, find a file or repair a setting far faster than clicking through menus. If you may use a Windows laptop one day, knowing it will make you feel at home in either system. The ideas are the same as on Ubuntu: a window, a program that reads your commands, and folders to move through. Only the command names differ. In this lesson every command only looks around or works inside a practice folder that you create.
Three names that are easy to mix up
On Ubuntu you learned that the Terminal is the window and the Shell is the program inside it that understands your commands. Windows follows the same split, but has two shells and one window program.
- Windows Terminal is the modern window. It can hold several tabs, and each tab can run a different shell. On Windows 11 it is normally the default.
- {{command-prompt|Command Prompt}} (also called
cmd) is the older shell. It has existed since the early days of Windows. It is simple, and many old guides use it. - {{powershell|PowerShell}} is the newer, more powerful shell. Its commands are called cmdlets and are named Verb-Noun, such as
Get-ChildItem. Windows 11 includes the older version called Windows PowerShell 5.1, which is what these lessons use.
Think of Windows Terminal as a phone and the two shells as two different messaging apps that run on it. You can change app without changing phone. Many beginner commands work in both shells, and PowerShell also accepts several old Command Prompt words (dir, cd, copy) as nicknames, called aliases.
Your commands go down, answers come back up
Read this figure as text
A stack showing you on top, Windows Terminal below, a choice of PowerShell or Command Prompt, and Windows at the bottom.
Four layers from top to bottom. 1: You, typing commands. 2: Windows Terminal, the window with tabs. 3: The shell running in a tab, which is either PowerShell or Command Prompt. 4: Windows, the operating system that does the work. A new tab can use either shell, and the shell can be changed without changing the window.
Opening a terminal on Windows 11
Open PowerShell in Windows Terminal
Step 1: Right-click the Start button
Right-click Start (or press the Windows key and X together). In the menu choose Terminal. On some Windows 11 versions this menu item is called Windows PowerShell instead; either is fine.
You should see: A window opens showing a line that begins with PS and ends with a greater-than sign, for example
PS C:\Users\Amina>.Step 2: Or search for it
Open Start, type
terminal(orpowershell) and click the result.You should see: The same kind of window opens.
Step 3: Open Command Prompt
Open Start, type
cmdand click Command Prompt. In Windows Terminal you can also click the small arrow beside the plus tab button and choose Command Prompt.You should see: A prompt such as
C:\Users\Amina>appears, with no PS in front.Step 4: Close it
Type
exitand press Enter.You should see: The tab or window closes. Nothing was changed.
The prompt is the shell's way of saying it is ready. It shows your current folder, the place where commands act unless you say otherwise. The PS in front tells you the shell is PowerShell. Never type the prompt itself.
PSShellPowerShell SpaceSeparatorC:\Users\AminaCurrent folderWhere commands act>ReadyType after thisRead this figure as text
The prompt PS C:\Users\Amina> broken into shell name, current folder and ready sign.
The prompt PS C:\Users\Amina> has three parts. PS means the shell is PowerShell (Command Prompt shows no PS). C:\Users\Amina is the current folder, which is Amina's user folder on drive C. The greater-than sign means the shell is waiting for a command. You type only what comes after it.
Looking around: where am I and what is here?
Windows paths use a backslash (\) between folders and start with a drive letter such as C:. Linux uses a forward slash. In PowerShell, Get-Location shows your current folder and Get-ChildItem lists what is inside it. The shorter nicknames pwd and ls also work in PowerShell, and Command Prompt uses cd with no argument and dir instead. Set-Location Documents (or cd Documents) moves you into a folder inside the current one, and cd .. moves one level up. These commands only read or move you; nothing is changed.
Get-Location
Get-ChildItem
Set-Location Documents
Get-Location
Set-Location ..- Marker 1: Where am I?
- Marker 2: What is here? d at the start of Mode means folder
- Marker 3: Moved in: the prompt now shows Documents
Read this figure as text
A simulated PowerShell window running Get-Location, Get-ChildItem, Set-Location Documents and back.
A simulated PowerShell window. Get-Location prints a table with a Path column and the value C:\Users\Amina (marker 1). Get-ChildItem prints a table of folders with the columns Mode, LastWriteTime, Length and Name; the folders shown are Desktop, Documents, Downloads and Pictures (marker 2). Set-Location Documents prints nothing, but the prompt changes to PS C:\Users\Amina\Documents> (marker 3). Set-Location .. returns to PS C:\Users\Amina>.
Dates are shown in your computer's local format, so yours may look different. The same actions in Command Prompt are shown below.
- Marker 1: cd alone prints the current folder
- Marker 2: dir lists; <DIR> marks a folder
- Marker 3: cd Documents moves in
Read this figure as text
A simulated Command Prompt showing cd printing the current folder, dir listing folders, cd Documents and cd ..
A simulated Command Prompt. The command cd with nothing after it prints the current folder C:\Users\Amina (marker 1). The command dir prints a listing with a header line Directory of C:\Users\Amina, then lines for the folders Desktop, Documents, Downloads and Pictures, each marked DIR (marker 2). cd Documents moves into that folder and the prompt becomes C:\Users\Amina\Documents> (marker 3).
Making a safe practice folder
From now on, anything that creates or changes files happens inside one folder called practice in your user folder. If you make a mistake, you only affect that folder. In PowerShell, $HOME is a built-in shortcut for your user folder (C:\Users\Amina). New-Item -ItemType Directory -Path $HOME\practice creates the folder; -ItemType Directory says you want a folder and -Path says where. Then Set-Location $HOME\practice moves you in, and New-Item -ItemType File -Name notes.txt creates an empty text file. Test-Path notes.txt answers True if it exists. In Command Prompt the matching commands are mkdir, cd and type nul > notes.txt.
Create the practice folder
Both shells do the same job. Use whichever you opened.
In PowerShell
Step 1: Create the folder
Type
New-Item -ItemType Directory -Path $HOME\practiceand press Enter.You should see: A small table appears listing a directory named practice with mode
d-----.Step 2: Move into it
Type
Set-Location $HOME\practice.You should see: The prompt now ends with
\practice>.Step 3: Create an empty file
Type
New-Item -ItemType File -Name notes.txt.You should see: A table lists notes.txt with Length 0.
Step 4: Check it exists
Type
Get-ChildItem.You should see: notes.txt is listed.
In Command Prompt
Step 1: Create the folder
Type
mkdir %USERPROFILE%\practiceand press Enter.You should see: No message. Silence means it worked.
Step 2: Move into it
Type
cd /d %USERPROFILE%\practice.You should see: The prompt ends with
\practice>.Step 3: Create an empty file
Type
type nul > notes.txt.You should see: No message.
Step 4: Check it exists
Type
dir.You should see: notes.txt is listed with size 0.
PowerShell and Linux side by side
If you already know some Ubuntu commands, this table helps. The ideas match; the names and slashes differ. Many PowerShell commands have a Linux-style nickname, but PowerShell's real names are longer so that they describe themselves.
| Task | Linux (Bash) | PowerShell | Command Prompt |
|---|---|---|---|
| Show current folder | pwd | Get-Location (alias pwd) | cd |
| List files | ls | Get-ChildItem (aliases ls, dir) | dir |
| Change folder | cd Documents | Set-Location Documents (alias cd) | cd Documents |
| Make a folder | mkdir practice | New-Item -ItemType Directory -Name practice | mkdir practice |
| Print text | echo hello | Write-Output hello (alias echo) | echo hello |
| Show file contents | cat notes.txt | Get-Content notes.txt (alias cat) | type notes.txt |
| Clear the screen | clear | Clear-Host (alias cls) | cls |
- Oldest shell
- Short commands: dir, cd, type
- Text output only
- Backslash paths
- Not case sensitive
- Newer, more capable
- Verb-Noun cmdlets
- Works with structured data
- Backslash paths
- Not case sensitive
- Linux shell
- Short commands: ls, cd, cat
- Text output
- Forward-slash paths
- Case sensitive
Read this figure as text
Three columns comparing Command Prompt, PowerShell and Linux Bash by age, command style and path separator.
Three columns. Command Prompt: the oldest shell, short commands such as dir and cd, text-only output, paths with backslashes. PowerShell: newer, cmdlets named Verb-Noun such as Get-ChildItem, and it can also work with structured data; paths with backslashes, and forward slashes are usually accepted too. Bash on Linux: short lower-case commands such as ls and cd, paths with forward slashes and case-sensitive names.
Common mistakes
✖ Instead of: Typing the prompt, for example
PS C:\Users\Amina> Get-Location.✔ Do this: The prompt appears by itself. Type only
Get-Location.✖ Instead of: Using forward slashes or Linux commands exactly as on Ubuntu, such as
ls -l.✔ Do this:
lsworks as a nickname in PowerShell, but the-loption does not exist there. UseGet-ChildItemand the options that PowerShell has.✖ Instead of: Opening PowerShell 'as administrator' for everyday practice.
✔ Do this: Use a normal window. Administrator windows can change the whole system; you do not need them to explore.
If something goes wrong
Cannot find path ... because it does not exist.- The folder name is misspelt or you are in a different folder. Run
Get-LocationandGet-ChildItem, then retype the path. If you have not yet createdpractice, create it first. 'foo' is not recognized as an internal or external commandin Command Prompt.- Check spelling. If you typed a PowerShell cmdlet such as Get-ChildItem in Command Prompt, switch to PowerShell or use
dir. - The Start button menu has no Terminal item.
- On some Windows versions it is named Windows PowerShell. You can also search for powershell or cmd in Start.
- Text I paste into the window looks wrong or does not run.
- Right-click usually pastes in Windows Terminal, and Ctrl+V works in current versions. Paste, read what appeared, and only press Enter if it is exactly what you intended.
Key terms
- Command Prompt
- The classic Windows program for typing commands.
- PowerShell
- A powerful Windows text tool where you type commands to control the computer.
- Windows Terminal
- A Windows app that gives you one window for command tools such as PowerShell and Command Prompt.
- Cmdlet
- A built-in command in PowerShell, named in a Verb-Noun style.
Practise it for real
Reading is not the same as being able to do it. Complete these on your own computer, then tick only what you have actually done. These ticks are your own honest record: nothing checks them for you.
Open a terminal and make your practice folder
On a Windows 11 computer, open Terminal (right-click Start). Run Get-Location, Get-ChildItem, then create $HOME\practice, move into it and create notes.txt. Run Get-ChildItem to confirm. Finish with exit.
Challenge: do the same job in both shells
Open Command Prompt as well. Without looking at the lesson, list the practice folder in both shells and move up to your user folder in both. Then write down two differences you noticed between the prompts and the outputs.
Knowledge check
6 questions. You need 80% to pass. Mistakes here are part of learning, and you can retry as often as you like.
Summary
- Windows Terminal is the window. PowerShell and Command Prompt are the shells inside it.
- PowerShell prompts start with PS; its commands are Verb-Noun cmdlets with short aliases.
- Get-Location, Get-ChildItem and Set-Location (or pwd, ls and cd) find your way around, like pwd, ls and cd on Linux.
- Create a practice folder first and work only there. Deleting from a command line is permanent.
Checklist: can you do these?
Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).
Related lessons
References and further reading
Official sources for details that can change between versions.
- Windows Terminal documentation (Microsoft Learn)
- PowerShell documentation (Microsoft Learn)
- Windows commands reference (Microsoft Learn)