The -P and -L options in the pwd command serve different purposes regarding how the current working directory is displayed:
-
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 -Pwill show the actual path. -
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 -Lwill 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!
