MIAP Digital Literacy Command Line Guide

Learn about BASH commands!

View on GitHub

The pwd Command

Summary

Command pwd stands for print working directory. It outputs the name of the directory you are currently in, called working directory.

Basic command structure

For all descriptions below, the dollar sign indicates that BASH command prompt.

$ pwd

When navigating through files and directories in the terminal, pwd shows where you are in the filesystem.

Output

The pwd command writes to standard output the full path name of your current directory (from the root directory).

All directories are separated by a / (slash).

The root directory is represented by the first /

The last directory named is your current directory.

screenshot of pwd output

Examples

Entering:

screenshot of pwd user

displays the current directory as:

screenshot of pwd current directory

Go back to the main list of commands