Forrest logo
back to the pwd tool

pwd:tldr:67ee8

pwd: Print the current directory, and resolve all symlinks (i.e. show the "physical" path).
$ pwd --physical
try on your machine

The command "pwd --physical" is used in the command line interface to display the current working directory (directory you are currently in) in its physical form.

When you navigate through directories in a file system, there are two types of paths you can encounter: logical paths and physical paths.

  • Logical paths are symbolic representations of directories and can include shortcuts or aliases. For example, if you have a symbolic link named "mylink" that points to the directory "/path/to/mydirectory", a logical path might be "/path/to/mylink".

  • Physical paths, on the other hand, are the actual physical locations of directories in the file system, without any shortcuts or aliases. In the previous example, the physical path would be "/path/to/mydirectory".

The "pwd" command is typically used to print the current working directory. However, when you add the "--physical" option to the command, it will specifically display the physical path of the current working directory.

So, running "pwd --physical" will give you the physical path of the directory you are currently in, providing the exact location in the file system.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pwd tool