MobDojoStart learning free

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.

11 min50 XPLab in Pro

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:

Here are a few safe commands that only show information:

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:

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:

  1. Disconnect from the internet.
  2. Run a full scan in Windows Security.
  3. From another device, change your important passwords, starting with email.
  4. 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.

Hands-on lab

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 lab
Test yourself

Can you answer these?

  1. In the lab, which command listed the files in the folder you were in?
  2. 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