Lesson 2
The terminal without fear
Learn to navigate, create files, and run commands safely on macOS, Linux, and Windows PowerShell.
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.
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.
cd ~/"My Rust course"Set-Location ~/"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
- Check where you are. Use
pwdorGet-Locationbefore creating or changing anything. - Read before pasting. Identify the command, every argument, and the destination path.
- 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.
cd ~
pwd
mkdir rusticiero-terminal
cd rusticiero-terminal
touch notas.txt
ls
cd ..
pwdSet-Location ~
Get-Location
New-Item -ItemType Directory -Path rusticiero-terminal
Set-Location rusticiero-terminal
New-Item -ItemType File -Path notas.txt
Get-ChildItem -Name
Set-Location ..
Get-LocationReasoned solution
cd ~orSet-Location ~establishes a known starting point; the next query confirms it.mkdiror the firstNew-Itemcreates the folder inside that location.- Changing directory makes the following commands act inside
rusticiero-terminal. touchor the secondNew-Itemcreatesnotas.txt; listing should show that name...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, andcd/Set-Locationlet you orient and move.mkdir/New-Itemcreates folders;touch/New-Itemcreates files; listing verifies the result.Ctrl+Casks an active process to stop. Checking location and reading before pasting are your best safeguards.