我在 CentOS 7 服务器上尝试列出一个子目录。当我第一次列出顶级目录时,它显示为空:
[me@server ~]$ ls -al /misc
total 4
drwxr-xr-x. 3 root root 0 Mar 13 12:49 .
dr-xr-xr-x. 20 root root 4096 Feb 1 09:54 ..
Run Code Online (Sandbox Code Playgroud)
但是,存在一个我具有读取/执行权限的子目录,可以列出:
[me@server ~]$ ls -al /misc/subdir
total 192
drwxr-xr-x. 50 root root 4096 Feb 25 09:52 .
drwxr-xr-x. 3 root root 0 Mar 13 12:49 ..
...other files and folders...
Run Code Online (Sandbox Code Playgroud)
在我第一次列出它之后,它出现在顶级目录中:
[me@server ~]$ ls -al /misc
total 8
drwxr-xr-x. 3 root root 0 Mar 13 12:49 .
dr-xr-xr-x. 20 root root …Run Code Online (Sandbox Code Playgroud)