Join our Newsletter — 33% off our NHI Course
Home› Guides› The Command Line for Beginners: Terminals, Shells and…
Guide Endpoint Security

The Command Line for Beginners: Terminals, Shells and Commands on Windows, macOS and Linux

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 2 December 2026 10 min read
On this page

The command line is a text window where you type instructions for your computer instead of clicking.

This guide is for anyone new to IT or security who has been told to "open a terminal" and felt lost. You do not need to use it to be affected: scammers now ask ordinary people to paste commands into it.

In short

  • The terminal is the window, the shell is the program that reads what you type, and together they make the command line.
  • Windows, macOS and Linux all have one, with different default shells.
  • A command runs with your rights, so it can change or delete things just like you can.
  • Never paste a command a website, email or stranger gives you unless you understand what it does.

What you will learn

  • Explain the difference between a terminal, a shell and a command.
  • Open the command line on Windows, macOS or Linux.
  • Spot a fake web page that asks you to paste a command.
  • Check what a command does before you run it.
Text window (terminal)
the window where you type commands and read the replies.
Command reader (shell)
the program inside the window that reads each command and runs it.

What is the command line?

Think of ordering at a cafe. You can point at pictures on a menu board, or you can say exactly what you want in words. Clicking icons is pointing. The command line is saying it in words.

The command line is a shell running inside a terminal window [1]. The terminal is the window. The shell is the program inside it that reads each line you type and carries it out.

Each line you type is a command. Extra words after a command are called arguments, and options change how the command behaves [1].

Where the comparison stops working: a cafe worker will query an odd order. A shell usually does exactly what you type, even if it is a mistake.

Why does it matter?

Many IT and security tasks are faster in text, and some can only be done there. The same power is why scammers want you to type their commands.

If you use a computer at home

What could happen: a fake "prove you are human" page tells you to paste a command, and it installs harmful software.

Check this: no real website check asks you to open the command line.

Next: ClickFix and Fake CAPTCHA Paste-and-Run Attacks Guide

If you are new to IT or security work

What could happen: you copy a command from a forum and run it with admin rights without reading it.

Check this: look up each command in its help page before you run it.

Next: Linux Command Line for Beginners

If you manage a team's computers

What could happen: staff who never need the command line are tricked into using it.

Check this: ask whether everyday users need the Run box, and limit it where they do not.

Next: PowerShell Security for Beginners

What does it look like?

This is a made-up version of a scam page that asks you to use the command line. Spotting it is a basic command line safety skill.

Example only. All values are made up.

verify.example.invalid
  Verify you are human                                   (1)
  Step 1: Press the Windows key and R together           (2)
  Step 2: Press Ctrl and V to paste                      (3)
  Step 3: Press Enter
  [ I am not a robot ]   Ref: FAKE-0000                  (4)
  1. It looks like a normal "are you human?" check.
  2. This opens the Windows Run box, which can start commands.
  3. The page has already copied a hidden command for you to paste.
  4. In a real message, this button would copy a harmful command, not a reference number.

Why this is risky: whatever you paste runs with your rights, so it can install software or send data away.

The safer way: close the page. Real checks are done by clicking or picking pictures, not by typing commands.

How does it work?

  1. You open a terminal. On Windows, Windows Terminal can host Command Prompt, PowerShell and bash [2]. On a Mac, the app is called Terminal [3]. Linux desktops have a terminal app too [1].
  2. The shell shows a prompt. A prompt is a short line of text that means "ready for your command". On a Mac, the default shell is zsh [4].
  3. You type a command and press Enter. Spelling and case matter. On Linux and other Unix systems, "A.txt" and "a.txt" are two different files [1].
  4. The shell asks the operating system to do it. The operating system is the main program that runs the computer. The command runs with your rights.
  5. You read the reply. The result, or an error message, appears as text under your command.
Diagram titled From your keyboard to the computer. Four boxes in a row joined by arrows. You: type a command and press Enter. Terminal: the window, such as Windows Terminal, macOS Terminal or a Linux terminal app. Shell: reads the command, such as PowerShell, Command Prompt, zsh or bash. Operating system: does the work with your rights. A green box underneath says: before you press Enter, know what the command does, and never paste one from a pop-up, email or stranger.
Figure 1. The terminal is the window, the shell reads your command, and the operating system carries it out with your rights.

Some commands need extra rights. On Linux, a command that starts with sudo runs with administrator power. One official tutorial advises treating any new use of sudo as being as dangerous as signing in as the all-powerful root account [1].

The command line is also where many tools that act on their own get started. A saved list of commands, called a script, can run each night with no one watching. If that script holds a password, the password is only as safe as the file.

A worked example

Dario Lindahl works on the help desk at a small marketing firm. His manager, Amara Pajari, wants him to learn the command line, starting with look-only commands that do not change anything.

On his Windows laptop, Dario opens Windows Terminal. He sees that it can open PowerShell or Command Prompt in tabs. He types a command that shows which folder he is in, then one that lists the files in it. Nothing changes; he is only looking. Then he tries the same on a Linux test machine and finds that the commands have different names.

The next week, a member of staff phones him. A website told her to press two keys, paste something and press Enter to "prove she is human". She stopped before pressing Enter, because it felt odd.

Dario remembers what he has read. Microsoft has described this trick, called ClickFix, which tries to get people to run harmful commands on their own devices [5]. He tells her to close the page and not to paste anything.

Amara reports the site through the firm's normal process. She also asks their IT supplier whether staff who never need the Run box can have it turned off. Microsoft lists limiting access to the Run box, where staff do not need it, as one defence [5].

Dario adds a line to the help desk notes: "No real website asks you to paste a command. Close it and call us."

Myths and mistakes

What people thinkWhat is true
The command line is only for hackers.It is an everyday tool for IT staff, developers and security teams on every major system.
A command from a help forum is safe because others used it.Read and understand it first. It runs with your rights.
A website might really need me to paste a command to prove I am human.That is a known scam pattern. Close the page.
Windows, macOS and Linux all use the same commands.Ideas carry over, but command names and shells differ between systems.

What can I do this week?

  • Open the terminal on your own computer and find the prompt.
  • Try one look-only command from a trusted guide for your system.
  • Tell friends and colleagues: no real site asks you to paste a command.
  • If you run a team's computers, ask who needs the Run box.

Checklist

  • I can explain the terminal, the shell and a command in one line each.
  • I know how to open the command line on the systems I use.
  • I read and understand any command before I run it.
  • I never paste commands from pop-ups, emails or strangers.
  • I use admin rights only when a task needs them.
  • Scripts I write hold no passwords or keys.

Common questions

Is the terminal the same as the shell?

No, though people often use the words loosely. The terminal is the window you type into. The shell is the program inside it that reads your commands, such as PowerShell, zsh or bash. One terminal app can open several different shells in separate tabs.

Can I break my computer by typing a command?

Yes, some commands can delete files or change settings. Look-only commands, such as listing files in a folder, change nothing. Start with those, read the help page for anything new, and be extra careful with any command that needs admin rights.

Do I need the command line to work in security?

Most security roles use it at least sometimes, because many tools and servers are run from text. You do not need to know it all at once. Learning to move around folders, read files and read help pages is a good first step.

What should I do if I already pasted a command from a website?

Disconnect from the internet if you can and tell your IT team or supplier straight away. Do not keep using the computer for banking or work sign-ins until it has been checked. At home, ask a trusted IT helper to check the device.

Where next?

Ready for the detail? Read the practitioner guide: Linux Fundamentals for Defenders Guide. It goes further into Linux files and permissions, users and services, and the logs defenders read from the command line.

Also useful:

Related NHI Mgmt Group resources: AI Command-Line Tools and Local Secrets, Linux Permissions for Beginners and Non-Human Identities for Beginners.

Key terms

Command-line interface
A way to use a computer or tool by typing text commands.
Terminal
The window where you type commands; on a Mac, also the name of the app.
Shell
The program that reads your commands and asks the computer to carry them out.
Prompt
The short text a shell shows when it is ready for your next command.
PowerShell
A shell and scripting language used to manage systems.
Sudo
A Linux command that runs another command with administrator rights.

Sources and further reading

  1. Canonical, "The Linux command line for beginners", Ubuntu tutorials. https://ubuntu.com/tutorials/command-line-for-beginners (accessed 2 Dec 2026).
  2. Microsoft, "What is Windows Terminal?", Microsoft Learn. https://learn.microsoft.com/en-us/windows/terminal/ (accessed 2 Dec 2026).
  3. Apple, "Terminal User Guide", Apple Support. https://support.apple.com/guide/terminal/welcome/mac (accessed 2 Dec 2026).
  4. Apple, "Change the default shell in Terminal on Mac", Terminal User Guide. https://support.apple.com/guide/terminal/change-the-default-shell-trml113/mac (accessed 2 Dec 2026).
  5. Microsoft Threat Intelligence and Microsoft Defender Experts, "Think before you Click(Fix): Analyzing the ClickFix social engineering technique", Microsoft Security Blog, 21 August 2025. https://www.microsoft.com/en-us/security/blog/2025/08/21/think-before-you-clickfix-analyzing-the-clickfix-social-engineering-technique (accessed 2 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.