How does -P option work?

The -P option in the pwd command stands for "physical." When you use pwd -P, it prints the current working directory as a physical path, resolving any symbolic links to show the actual directory on the filesystem.

For example:

cd /some/symlink
pwd -P

If /some/symlink points to /actual/directory, the output will be /actual/directory, showing the real path rather than the symbolic link.

In summary:

  • pwd -L: Shows the logical path, including symbolic links.
  • pwd -P: Shows the physical path, resolving any symbolic links.

0 Comments

no data
Be the first to share your comment!