Linux常用命令-pwd 发表于 2020-12-17 分类于 command 命令pwd 描述Print the name of the current working directory显示当前工作目录 用法1pwd [-LP] 选项123Options: -L 显示当前工作目录,默认选项 -P 显示物理目录,如果是软链接则显示源目录 两个默认系统变量$PWD 当前工作目录,同pwd命令$OLDPWD 上一次的工作目录cd - 可以使用该命令来切换以上两个目录 注意无 示例123456789101112$ lldrwxr-xr-x 2 root root 6 Dec 17 23:13 d1/lrwxrwxrwx 1 root root 2 Dec 17 23:13 d2 -> d1/$ cd d1$ pwd/root/d1$ cd ../d2$ pwd/root/d2# 显示软链接的源目录路径$ pwd -P/root/d1