ls -al 抛出乱码。看不到所有权,全部换成审讯?符号

ls -al 抛出乱码。看不到所有权,全部换成审讯?符号

使用命令时出错ls -al /xx会引发乱码。我尝试复制、修改所有权、权限,但没有任何更改。 root 和用户也会发生这种情况。我正在 sysv 模式下运行 systemd ( apt install systemd-sysv)。作为初始化替换。我无法定义那在哪里???来自。

$ ls -al /xbin    
d????????? ? ? ? ? ? .
d????????? ? ? ? ? ? ..
d????????? ? ? ? ? ? ADMIN
-????????? ? ? ? ? ? apt-commands.sh
-????????? ? ? ? ? ? build-kernel.sh
-????????? ? ? ? ? ? cairo-dock.sh
-????????? ? ? ? ? ? chrome.sh
-????????? ? ? ? ? ? dirwatch.sh
-????????? ? ? ? ? ? export_notebook.sh
-????????? ? ? ? ? ? find_duplicates.sh
-????????? ? ? ? ? ? findsortdate.sh
-????????? ? ? ? ? ? functions.sh
-????????? ? ? ? ? ? get-chromium.sh
-????????? ? ? ? ? ? get-kernel.sh
d????????? ? ? ? ? ? .git
-????????? ? ? ? ? ? github-create.sh

难道是和扩展属性有关?

答案1

lswith -l/ -n...?当它可以列出目录的内容但无法检索其中文件的元数据(使用lstat()或 (with -L)stat系统调用,或诸如 之类的变体statx())时显示这些内容。

一个常见的情况是当你有允许 ( r) 但不允许搜索x对该目录的权限 ( )。在这些情况下,stat*()系统调用会失败并显示EACCESS(没有权限)。

$ mkdir dir
$ touch dir/{1,2}
$ chmod u=r,go= dir
$ ls -la dir
ls: cannot access 'dir/1': Permission denied
ls: cannot access 'dir/..': Permission denied
ls: cannot access 'dir/2': Permission denied
ls: cannot access 'dir/.': Permission denied
total 0
d????????? ? ? ? ?            ? ./
d????????? ? ? ? ?            ? ../
-????????? ? ? ? ?            ? 1
-????????? ? ? ? ?            ? 2

其他情况可能来自文件系统损坏,当目录包含引用不存在的 inode 的条目时。

您可以通过以下方式查看ls -lL损坏的符号链接:

$ ln -s /broken .
$ ln -s broken2 broken2
$ ls -lL
ls: cannot access 'broken2': Too many levels of symbolic links
ls: cannot access 'broken': No such file or directory
total 0
l????????? ? ? ? ?            ? broken
l????????? ? ? ? ?            ? broken2

相关内容