MobDojoStart learning free

Mac Inside & Out · macOS Under the Hood · Lesson 3 of 5

Terminal Basics on a Mac

Open Terminal, try a few safe commands, and never paste a stranger's.

10 min50 XPLab in Pro

Opening Terminal and looking around

Terminal is a Mac app where you type commands instead of clicking. A command is a short typed instruction. Typing commands like this is called using the command line.

To open Terminal, press Command+Space to open Spotlight, type "Terminal" and press Return. It also lives in Applications, inside the Utilities folder.

A plain window opens with a line of text ending in a % sign. This is the prompt, where Terminal waits for you. The program reading your commands is called the shell. Recent versions of macOS use a shell called zsh.

Here are four safe commands. They only look around and never change anything. Type one, then press Return.

Try pwd, then cd Documents, then pwd again. You'll see the folder change. It's the same as opening folders in Finder, just with words.

When you're done, close the window. Be careful with any command that starts with sudo. It runs with admin power and asks for your password.

On Windows, the matching app is also called Terminal, and it runs PowerShell.

The command you should never paste

Terminal does exactly what you type, with your account's power. It never asks if you're sure. One pasted line can download a program and run it, all in a second.

Scammers have figured this out, and they now target Mac users too. Two tricks are common.

Fake fix sites. You search for help, like "speed up my Mac" or "fix storage full". A helpful looking page, sometimes a paid ad at the top of the results, says to open Terminal and paste a line to fix it.

Fake CAPTCHAs. A CAPTCHA is a test that checks you're a person, like ticking a box or picking pictures. A fake one says "Verify you are human: press Command+Space, type Terminal, paste this and press Return." A real CAPTCHA never asks you to open Terminal.

The pasted line often looks like a jumble or starts with curl, a command that downloads files. What it fetches is usually a stealer, a program that grabs saved passwords, browser data and more. Some then pop up a box asking for your Mac password. Typing it there hands over the keys.

The rule is simple. Never paste a command from a website, pop-up, email, chat or caller. Real apps come from the App Store or the maker's own site.

If you already ran one, disconnect from Wi-Fi, change your important passwords from another device, and get trusted help.

Test yourself

Can you answer these?

  1. You want to know which folder Terminal is in right now. Which command do you type? (one word)
  2. A page says "Verify you are human. Open Terminal and paste this code." What is it?

Answer them in the app to earn 50 XP (Pro).

Answer in the app