Windows Inside & Out · Windows Under the Hood · Lesson 4 of 5
Command Line Basics
Try a few safe commands, and learn the one rule that keeps the terminal safe.
Meet the terminal
Most of the time you use a computer by clicking. There's another way: typing. A command is a short typed instruction, like ipconfig.
A command line is a place where you type commands and read the answers as text. On Windows 11, the app for this is Terminal. To open it, right-click the Start button and choose Terminal.
A shell is the program inside Terminal that reads your commands and carries them out. Windows has two:
- PowerShell: the newer, more powerful one. Terminal usually opens it first.
- Command Prompt: the older one. Many old guides use it.
Here are a few safe commands that only show information:
- whoami: shows which account you're signed in with.
- dir (or ls in PowerShell): lists the files in the folder you're in.
- cd Documents: moves into your Documents folder. cd means "change directory." A directory is another word for folder.
- ipconfig: shows your network addresses.
- ping library.example: checks whether a website answers, and how quickly.
- Get-Process: in PowerShell, lists the programs running right now.
- cls: clears the screen.
Type a command, then press Enter to run it. Press the up arrow key to bring back the last command.
Some commands need Administrator mode, which allows changes to the whole computer. You don't need it for these.
On a Mac, the app is also called Terminal, in Applications > Utilities. Many commands are different there.
On the practice computer, run whoami, list your files, move into Documents, then try ipconfig and Get-Process.
Never paste a stranger's command
The terminal is powerful. One line can download a program, change settings, or send your files somewhere. That's why scammers love it.
A dangerous command doesn't have to look scary. A short, harmless-looking line can quietly download and run malware.
Watch for these tricks:
- A caller says he's from Microsoft or your bank and asks you to open Terminal and paste something. Microsoft doesn't make surprise calls to fix your computer.
- A website shows a fake "I'm not a robot" check. It says to press Windows+R, then Ctrl+V, then Enter. The page has secretly copied a harmful command for you to paste. Real robot checks never ask you to run anything.
- A video or forum post promises a free app or a speed boost if you "just copy and run this."
- A chat message from a "friend" whose account may have been taken over.
Windows+R opens the Run box, a small box that runs a command right away. It's just as risky as Terminal.
The rule is simple. Never paste and run a command from someone you don't know, or one you don't understand. Even if a trusted helper sends one, ask what it does first.
If you already ran something suspicious:
- Disconnect from the internet.
- Run a full scan in Windows Security.
- From another device, change your important passwords, starting with email.
- Get help from someone you trust, or a local repair shop.
On a Mac, the same trick tells you to paste a command into Terminal. The rule is the same.
Try it on the practice computer
This lesson has a lab on a pretend computer right in your browser: windows, menus and settings that behave like the real thing. Nothing you do touches your own computer.
Open the labCan you answer these?
- In the lab, which command listed the files in the folder you were in?
- A web page's robot check tells you to press Windows+R, paste, and press Enter. Is it real or a scam?
Answer them in the app to earn 50 XP (Pro).
Answer in the app