小编Luk*_*rau的帖子

使用 cd 时使用 /

我在我的 mac 上的主目录中:

$ pwd
/Users/lukas
Run Code Online (Sandbox Code Playgroud)

当我cd在附近时,我不会(也不能)以以下方式开始路径/

$ cd Documents/
/Users/lukas/Documents

$ cd /Documents
-bash: cd: /Documents: No such file or directory
Run Code Online (Sandbox Code Playgroud)

除非我在/

$ pwd
/
$ cd Users
/Users

$ cd /Users
/Users
Run Code Online (Sandbox Code Playgroud)

为什么我可以/在从/to时在路径前面使用/Users但在任何后续级别中都不能使用?这是特定于 macOS 还是标准的 Unix 行为?

linux mac terminal command-line

12
推荐指数
2
解决办法
3327
查看次数

标签 统计

command-line ×1

linux ×1

mac ×1

terminal ×1