pwd(1)
Print the full pathname of the current working directory.
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
| Flag | What it does |
|---|---|
-L | Print the logical current working directory (may include symlink names) |
-P | Print the physical current working directory (default; resolves symlinks) |
--help | Display help message and exit |
--version | Output version information and exit |
Examples
Display the current directory path, e.g., /home/user/documents
pwdShow the logical path, useful when you've navigated via symlinks
pwd -LChange to /tmp directory and immediately display your new location
cd /tmp && pwdCreate a full path to a file in the current directory for use in scripts
echo $(pwd)/myfile.txtSave the current directory path to a file for later reference
pwd > current_dir.txtList files in the current directory using its absolute path
ls $(pwd)