$linuxjunkies
>

pwd(1)

Print the full pathname of the current working directory.

UbuntuDebianFedoraArch

Synopsis

pwd [OPTION]

Description

pwd outputs the absolute path of the directory you are currently in within the filesystem. This is useful for understanding your location in the directory tree, especially in shell scripts or when navigating complex directory structures.

By default, pwd resolves symbolic links and prints the physical directory path. Use the -L flag to print the logical path including any symbolic link components.

Common options

FlagWhat it does
-LPrint the logical current working directory (may include symlink names)
-PPrint the physical current working directory (default; resolves symlinks)
--helpDisplay help message and exit
--versionOutput version information and exit

Examples

Display the current directory path, e.g., /home/user/documents

pwd

Show the logical path, useful when you've navigated via symlinks

pwd -L

Change to /tmp directory and immediately display your new location

cd /tmp && pwd

Create a full path to a file in the current directory for use in scripts

echo $(pwd)/myfile.txt

Save the current directory path to a file for later reference

pwd > current_dir.txt

List files in the current directory using its absolute path

ls $(pwd)

Related commands