← Lessons/Navigate the Filesystem
← Navigate the Filesystem

List the files

Learn

A filesystem is a tree

A Linux filesystem is a tree of folders (called directories) and files. At any moment your shell sits in one directory, your current working directory: the "you are here" dot on a mall map. Commands act relative to where you're standing, so the first instinct of any seasoned operator landing on an unfamiliar machine is to look around.

  • pwd (print working directory) answers "where am I right now?" with the full path from the root of the tree.
  • ls lists what's in the current directory. Add -l for the long format: one file per line, with permissions, owner, size and modified time.

Type a single command into the terminal and press Enter.

Run ls to see what's in the current directory. You should see readme.txt and a data directory.

sandbox@opspath: ~
OpsPath sandbox · Debian GNU/Linux 12 · GNU bash 5.2
Each command runs in a fresh, isolated sandbox with this lesson's files in ~.
Nothing carries over between commands, so chain with && or | when you need to.
Type a command and press Enter. ↑/↓ history · Ctrl+L clear · Ctrl+C cancel line
# ── Step 1 · List the files ──
# Sign in to run commands — it's free.