Lesson 2

The terminal without fear

Learn to navigate, create files, and run commands safely on macOS, Linux, and Windows PowerShell.

Level
Intro
Duration
12 min
Updated

Seven words for knowing what is happening

The terminal is the application or window where you work. Inside it runs a shell: the program that reads what you type and asks the operating system to act. zsh and bash are common on macOS and Linux; on Windows, we will use PowerShell.

The shell displays a prompt when it is ready. You then type a command, the name of an action, and perhaps one or more arguments, data that alter that action. When you press Enter, the command may produce output —text in response— or an error message. Everything happens from a current directory, the folder the shell uses as its starting point.

Nothing in this lesson runs inside the website. The blocks only copy commands for you to use deliberately in your real terminal.

Command reading

  • LOCATION · ~/projectscurrent directory in the prompt
  • INPUT · command without prompt$ and PS> are not typed
  • RESULT · none yetthe shell is waiting for input
01 / 04PROMPT ≠ COMMAND

Paths: from where to where

An absolute path identifies a place from the system root: /Users/ana/projects on macOS, /home/ana/projects on Linux, or C:\Users\Ana\projects on Windows. A relative path starts in the current directory: from projects, course/examples means “enter course, then examples.”

Four symbols save work:

  • . means “this directory”;
  • .. means “the parent directory”;
  • ~ represents your home folder in the shells used in this lesson;
  • quotes keep a name containing spaces together.
Path containing spaces
cd ~/"My Rust course"

The quotes are part of the command and are copied. They prevent the shell from interpreting My, Rust, and course as separate arguments.

Read the response and correct errors

Some commands print data (pwd, Get-Location, ls), some finish silently (cd, Set-Location), and others remain active until they complete or receive Ctrl+C. If something fails, read the whole message. The most common cases are:

  • command not found: check the spelling and that the program is installed;
  • path not found: check your location, list its contents, and review case, spaces, and quotes;
  • permission denied: do not force the command; confirm that the location belongs to you and understand which permission is missing.

Do not add sudo, alter permissions, or try destructive variants merely to silence the error. The message is useful information.

Three safety habits

  1. Check where you are. Use pwd or Get-Location before creating or changing anything.
  2. Read before pasting. Identify the command, every argument, and the destination path.
  3. Do not run destructive instructions you do not understand.

A copyable block prevents typing mistakes, but it does not replace your decision. Paste only when you can explain what should change and how you will verify it.

Guided practice

Goal: from your home folder, create rusticiero-terminal/notas.txt, confirm that the file exists, and finish back in your home folder. If a folder with that name already exists, use another harmless location or inspect it before continuing; do not overwrite work you do not recognize.

Complete practice
cd ~
pwd
mkdir rusticiero-terminal
cd rusticiero-terminal
touch notas.txt
ls
cd ..
pwd

Reasoned solution

  1. cd ~ or Set-Location ~ establishes a known starting point; the next query confirms it.
  2. mkdir or the first New-Item creates the folder inside that location.
  3. Changing directory makes the following commands act inside rusticiero-terminal.
  4. touch or the second New-Item creates notas.txt; listing should show that name.
  5. .. moves exactly one level up, and the final query confirms that you returned to your home folder.

The folder remains as a harmless trace of the practice. You may keep it or remove it later in your file manager once you recognize its contents.

Summary

  • A terminal hosts a shell; the prompt means it is waiting but is not part of the command.
  • A command receives arguments and may print output, finish silently, or show an error.
  • Relative paths start at the current directory; ., .., ~, and quotes express them precisely.
  • pwd/Get-Location, ls/Get-ChildItem, and cd/Set-Location let you orient and move.
  • mkdir/New-Item creates folders; touch/New-Item creates files; listing verifies the result.
  • Ctrl+C asks an active process to stop. Checking location and reading before pasting are your best safeguards.

Sources