Art*_*ild 22
没有什么是错的。
\n/bin
是一个指向 的符号链接/usr/bin
。
当您使用该ls /bin
命令时,将跟随符号链接,并向您显示/usr/bin
(符号链接指向的位置)的内容。
但是,使用该ls -l /bin
命令时,不会遵循符号链接,而仅显示符号链接本身。
原因可以在--dereference-command-line-symlink-to-dir
ls texinfo 文档(info ls
或info coreutils \'ls invocation\'
)的选项下找到:
\xe2\x80\x98--dereference-command-line-symlink-to-dir\xe2\x80\x99\n Do not dereference symbolic links, with one exception: if a command\n line argument specifies a symbolic link that refers to a directory,\n show information for that directory rather than for the link\n itself. This is the default behavior when no other\n dereferencing-related option has been specified (\xe2\x80\x98--classify\xe2\x80\x99\n (\xe2\x80\x98-F\xe2\x80\x99), \xe2\x80\x98--directory\xe2\x80\x99 (\xe2\x80\x98-d\xe2\x80\x99), (\xe2\x80\x98-l\xe2\x80\x99), \xe2\x80\x98--dereference\xe2\x80\x99 (\xe2\x80\x98-L\xe2\x80\x99), or\n \xe2\x80\x98--dereference-command-line\xe2\x80\x99 (\xe2\x80\x98-H\xe2\x80\x99)).
Run Code Online (Sandbox Code Playgroud)\n在这种情况下,-l
是“其他与取消引用相关的选项”并关闭该行为。
如果您使用ls -lH /bin
,则告诉命令专门遵循符号链接,现在您(正确地)看到 的内容/usr/bin
。
/bin
作为UsrMerge/usr/bin
软件包的符号链接,该软件包于 2019 年在 Debian 10 中引入,并被以下版本的 Ubuntu 采用。