cd [-L] [-P] [-e] [-@] 起什么作用?

cd [-L] [-P] [-e] [-@] 起什么作用?

出于好奇,我输入了 cd --help 来查看是否可以通过更改目录来执行其他操作,结果出现了

cd: usage: cd [-L|[-P [-e]] [-@]] [dir]

每个选项的作用是什么?我尝试进行 DDG 搜索,但在这些额外参数上没有找到任何内容。有人可以在我尝试之前解释一下吗?我发现 -L 会删除该目录中找到的所有文件,但不会删除目录本身或类似的东西,哈哈 :-)

答案1

尝试help cd

 Options:
    -L  force symbolic links to be followed: resolve symbolic links in
    DIR after processing instances of `..'

    -P  use the physical directory structure without following symbolic
    links: resolve symbolic links in DIR before processing instances
    of `..'

    -e  if the -P option is supplied, and the current working directory
    cannot be determined successfully, exit with a non-zero status

    -@  on systems that support it, present a file with extended attributes
        as a directory containing the file attributes

相关内容