Linux command list

pwd command: show the directory you are in

__ __ _ _____
\ \ / /__| |_|_ _|__ _ __ _ __ ___
\ \ /\ / / _ \ '_ \| |/ _ \ '__| '_ ` _ \
\ V V / __/ |_) | | __/ | | | | | |
\_/\_/ \___|_.__/|_|\___|_| |_| |_| |_
 
A sandbox for trying pwd. Nothing here can touch your real files.
user@webterm:~/project/src/components$
 

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

Syntax

pwd

No arguments, no options. It prints the absolute path of the current directory on one line.

Try it first

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.

Your location changes as you move

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.

When you actually reach for it

pwd is rarely interesting on its own. It is what you type right before doing something that depends on where you are.

SituationWhy it matters
Before rmDeleting from the wrong directory is not undoable
Before passing a relative pathWhat ../config points at depends on your location
When a command fails"No such file" is often the wrong directory, not a typo
When writing instructionsAbsolute 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/

Things that trip people up

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.

Practise it hands-on

>_WEBTERM LEARN

WebTerm Learn: from one command to actually using it

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

Related commands

cd / ls

Frequently asked questions

What does pwd stand for?
Print working directory. It prints the absolute path of the directory you are working in.
What is pwd actually for?
A terminal does not always show where you are. After a few cd commands, pwd is how you confirm your location before deleting a file or running something that depends on the current directory.
What is the difference between an absolute and a relative path?
An absolute path starts with / and means the same place from anywhere, such as /home/user/project. A relative path is directions from where you are now, such as src or ../docs. pwd always prints an absolute path.
Is the prompt showing the same thing as pwd?
Usually, but many prompts shorten your home directory to ~. pwd never abbreviates, so it is the reliable answer.
What is the Windows equivalent?
In the Command Prompt, running cd with no arguments prints the current directory. In PowerShell, pwd works as an alias for Get-Location.