Skip to content
BENIBIX Learn

pwd

Infrastructure⌨️ Linux & the Command LineFiles and Folders

Also known as pwd Command, Print Working Directory, Current Working Directory

A command that prints which folder you are in right now.

Think of it like

Think of it like the dot on a map that says you are here.

Example

Jack runs a script, and it says the file is not found. He types pwd and sees he is in the wrong folder.

Why it matters

Many errors come from running a command in the wrong folder. pwd tells you in one word.

Definition

The pwd command prints the folder you are in right now. Its name is short for print working directory. Every command you type runs from this folder. So pwd is the first thing to check when a file seems to be missing. It prints the full path, starting from the root.

Example code

console
$ pwd
/home/jack/projects
The answer is the full path to the folder Jack is in.
The marker shows the folder you are in. That is the path pwd prints.

Common mistake

Guessing where you are from the prompt. Some prompts hide the full path, so check with pwd.

Key takeaways

  1. 1
    You are here. Prints the current folder.
  2. 2
    Full path. Starts from the root.
  3. 3
    Check first. Before you blame a missing file.

Learn it properly