How does the '-P' option differ from the '-L' option in the 'pwd' command?

The -P and -L options in the pwd command serve different purposes regarding how the current working directory is displayed:

  1. pwd -P (Physical):

    • Displays the physical path of the current working directory.
    • It resolves all symbolic links and shows the actual directory path on the filesystem.

    Example:
    If you are in a symbolic link directory that points to another directory, pwd -P will show the actual path.

  2. pwd -L (Logical):

    • Displays the logical path of the current working directory.
    • It shows the path as it appears in the filesystem, including any symbolic links.

    Example:
    If you are in a symbolic link directory, pwd -L will show the path of the symbolic link itself.

Summary:

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

If you have any more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!