pwd prints where you currently are, as an absolute path. Learn how to check your bearings after moving around with cd, by running the commands in a real terminal in your browser.
Updated: 2026-09-04
pwd
No arguments, no options. It prints the absolute path of the current directory on one line.
The terminal on this page starts deep inside a project.
$ pwd
/home/user/project/src/components
The leading / makes this an absolute path. In one line you can see that you are inside components, which sits under src, which sits under project.
Every cd changes what pwd reports. Moving, then checking, is the basic pairing.
$ cd ../..
$ pwd
/home/user/project
$ cd
$ pwd
/home/user
cd ../.. goes up two levels, and cd with no argument returns you to your home directory.
pwd is rarely interesting on its own. It is what you type right before doing something that depends on where you are.
| Situation | Why it matters |
|---|---|
Before rm | Deleting from the wrong directory is not undoable |
| Before passing a relative path | What ../config points at depends on your location |
| When a command fails | "No such file" is often the wrong directory, not a typo |
| When writing instructions | Absolute paths let the reader start from anywhere |
Pairing it with ls gives you the two facts you need to get unstuck: where you are, and what is there.
$ cd project
$ pwd
/home/user/project
$ ls
docs/ README.md src/
The output is always absolute.
Even if you arrived by relative moves, pwd answers with the full path from /. It reports where you are, not how you got there.
It is not the same as your prompt.
Prompts often shorten the home directory to ~. pwd does not abbreviate, so reach for it when you need the exact location.
pwd never moves you.
It only reports. Use cd to actually change directory.
Terminal for Beginners
Learn basic commands

Commands stick when they show up in a real sequence of work, not one at a time. There is a course that builds them up in order.
See the course