Linux command
pwd 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Print working directory
pwd
Print physical path (no symlinks)
pwd -P
Print logical path (with symlinks)
pwd -L
说明
pwd prints the absolute path of the current working directory. It is one of the most basic shell commands, used to confirm your location in the filesystem when navigating between directories. The -P flag resolves symbolic links to display the physical path, while -L (the default in most shells) preserves symbolic link components in the path. Both a shell built-in version and a standalone binary from GNU coreutils exist; the built-in is used by default in interactive shells.
参数
- -L
- Logical path (follow symlinks).
- -P
- Physical path (resolve symlinks).
FAQ
What is the pwd command used for?
pwd prints the absolute path of the current working directory. It is one of the most basic shell commands, used to confirm your location in the filesystem when navigating between directories. The -P flag resolves symbolic links to display the physical path, while -L (the default in most shells) preserves symbolic link components in the path. Both a shell built-in version and a standalone binary from GNU coreutils exist; the built-in is used by default in interactive shells.
How do I run a basic pwd example?
Run `pwd` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -L do in pwd?
Logical path (follow symlinks).