How Folder Navigation Works

In a graphical file browser, you click folders to open them and see their contents. In a terminal, you navigate the same folder structure — but instead of clicking, you type paths. Understanding how paths work is fundamental to using the command line effectively.

Paths Describe Location

A file path is like an address. It tells the computer exactly where something is located in the file system. There are two types:

Absolute paths start from the root of the file system and describe the complete location. On Unix-like systems (macOS, Linux), they begin with /. On Windows, they start with a drive letter like C:\.

Relative paths describe location relative to where you currently are. If you're in /Users/alex and want to reach /Users/alex/projects, the relative path is simply projects.

Essential Navigation Commands

Three commands form the foundation of terminal navigation:

  • pwd (print working directory) — shows your current location
  • cd (change directory) — moves you to a different folder
  • ls (list) — shows what's in the current folder
  • cd — shows your current location (or changes it with an argument)
  • cd (change directory) — moves you to a different folder
  • dir — shows what's in the current folder

Seeing It in Action

The Mental Model

Think of navigating a city by street addresses rather than wandering visually. When someone asks where you are, you don't say "near the coffee shop" — you give an address. The terminal works the same way: your location is always a specific path.

This explicitness has advantages. You always know exactly where you are. Commands operate on exactly what you specify. There's no ambiguity about which folder you're working in.

Why This Matters

Every command you run in a terminal happens in the context of your current directory. If you run a command to create a file, it appears in your current location. If you run a program, it looks for files relative to where you are.

Getting comfortable with path-based navigation is the first step toward command-line fluency. The folder structure is identical to what you see in graphical file browsers — you're just describing it with text instead of clicks.

See More

You need to be signed in to leave a comment and join the discussion