如何找到当前工作目录的路径?

Pra*_*ady 1 shell

如何找到当前工作目录的路径?

Tim*_*imo 7

随着命令pwd。但请注意,这不会解析您路径中可能存在的任何链接,因为您需要pwd -P.

mkdir abc
ln -s abc def
cd def
pwd    # should give a path ending in "def"
pwd -P # should give a path ending in "abc"
Run Code Online (Sandbox Code Playgroud)

从路径pwdpwd -P是否有任何路径的组件链接到最后的部分将是不同的。