Linux pwd命令详解

pwd 显示当前操作的目录
pwd命令是Linux系统中的一个内置命令,它的全称是print working directory,即打印当前工作目录。它的作用是显示当前用户所在的工作目录的绝对路径。

命令格式:
pwd [OPTION]…

选项:

-L:显示当前工作目录的符号链接路径;

-P:显示当前工作目录的物理路径;

–help:显示帮助信息。

使用实例:

1、查看当前工作目录的绝对路径:

[root@localhost ~]# pwd
/root

2、查看当前工作目录的符号链接路径:

[root@localhost ~]# pwd -L
/root

DESCRIPTION
       Print the full filename of the current working directory.

       -L, --logical
              use PWD from environment, even if it contains symlinks

       -P, --physical
              avoid all symlinks

       --help display this help and exit

       --version
              output version information and exit

       If no option is specified, -P is assumed.

       NOTE: your shell may have its own version of pwd, which usually supersedes the version described here.  Please
       refer to your shell's documentation for details about the options it supports.