Module 1 · Linux: the 20 everyday commands · Lesson 2 of 16

Find your way: pwd, ls, cd

Know where you are, see what is there, and move between folders.

In this lesson · about 18 minutes

  • Use pwd to see where you are
  • Use ls with -l, -a and -h to see what a folder holds
  • Move around with cd, using full paths, relative paths, .., ~ and -

Key terms

Say the meaning to yourself, then tap a card to check.

Paths: the address of a file

Every file has an address called a path. The very top of the tree is / (called root). Sam's home folder is /home/sam, and the résumé inside it is /home/sam/documents/resume.pdf.

  • A full (absolute) path starts with / and works from anywhere: cd /home/sam/photos.
  • A relative path starts from where you are now: if you are in /home/sam, then cd photos is enough.
  • ~ means your home folder, . means "this folder" and .. means "the folder above".

Reading ls -l

-rw-r--r-- 1 sam sam   96 Nov 20 08:47 notes.txt
drwxr-xr-x 2 sam sam 4096 Nov 18 14:02 photos
PartMeaning
- or dFirst letter: d = directory (folder), - = ordinary file
rw-r--r--Permissions: who may read, write or run it (lesson 5)
sam samThe owner and the group
96Size in bytes (add -h for 4K, 2.4M…)
Nov 20 08:47Last changed

Files whose names start with a dot, like .bashrc, are hidden: they hold settings. ls -a shows them.

Whiteboard · watch and try

Walking the folder tree

4 steps
Press Play and the tutor will talk you through it while writing on the board. Pause any time to write on the board yourself.

Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.

Practice terminal · missions

Explore Sam's server

Watch the you are here marker in the file picture move as you type.

Missions 0 of 9

  1. 1Find out which folder you are in.
  2. 2List what is in this folder.
  3. 3List again, with details AND hidden files (two options).
  4. 4Move into the documents folder.
  5. 5Show the files here with human-friendly sizes.
  6. 6Go up one level, back to the home folder.
  7. 7Jump straight into the trip folder inside photos, in one command.
  8. 8Go back home in the shortest way possible.
  9. 9Use a full path to look inside /etc without moving there.
sam@practice-box:~

Type a command and press Enter. Try help to list commands. Tab finishes names, ↑ repeats.

  • ~ (/home/sam)you are here
  • documents
  • budget-2026.csv
  • letters
  • thank-you.txt
  • meeting-notes.txt
  • resume.pdf
  • downloads
  • installer.zip
  • report-final-v2.pdf
  • report-final.pdf
  • logs
  • access.log
  • app.log
  • old
  • app-2026-09.log
  • app-2026-10.log
  • notes.txt
  • photos
  • beach.jpg
  • cat.png
  • trip
  • day1.jpg
  • day2.jpg
  • projects
  • website
  • index.html
  • style.css
  • scripts
  • backup.sh
  • hello.shruns
  • todo.md

This picture updates as you type. Changed items flash. runs = executable, a name badge = owned by someone else.

Check your understanding0 of 4 correct

Question 1

1.You are in /home/sam/photos. Where does cd .. take you?

Question 2

2.Which command shows hidden files such as .bashrc?

Question 3

3.In ls -l output, a line starts with d. What is it?

Question 4

4.Which path works no matter which folder you are in?

Quiz score: 0 of 4

Tip: answer every quiz question correctly first.

Written by Noviq Academy in its own words. The practice terminal is a simulation that runs in your browser: it imitates Linux (Ubuntu-style output) and Git closely, but it is not a real computer, and real output can differ slightly. The servers, people, web addresses and GitHub addresses in the labs are made up. Linux is a trademark of Linus Torvalds; Git and GitHub belong to their owners. Read-aloud uses your device's built-in voices.