Linux 上奇怪的“隐形”目录

Linux 上奇怪的“隐形”目录

我在一台 Linux 机器上,正在使用一个名为“stealth”的目录,因为它运行并隐藏!看看这个行为:

bash-3.2$ ls /net
bash-3.2$ ls -la /net
total 4
drwxr-xr-x  2 root root    0 Jun 19 16:10 .
drwxr-xr-x 29 root root 4096 Jun 15 09:51 ..
bash-3.2$ ls /net/stealth
dir1  dir2  SERVER_LINK
bash-3.2$ ls /net
stealth
bash-3.2$ ls -la /net
total 4
drwxr-xr-x  3 root root    0 Jun 19 16:59 .
drwxr-xr-x 29 root root 4096 Jun 15 09:51 ..
dr-xr-xr-x  6 root root    0 Jun 19 16:59 stealth
bash-3.2$ uname -a
Linux cfnyps1u 2.6.18-348.18.1.el5 #1 SMP Fri Sep 6 12:37:18 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

(注意列出隐身目录内容之前和之后 ls /net 的输出之间的差异)

这种类型的目录的名称是什么?为什么它会“隐藏”直到“找到”它?我最终弄清楚发生了什么事,但我以前从未见过这种行为,这肯定会使使用标准方法更难找到目录的内容。

答案1

您正在看到 autofs 行为。 /net 往往包含自动安装的目录。自动安装的目录只有在您专门使用时才会安装。它们将保持安装状态一段时间,然后如果在该时间段内未使用,它们将自动卸载。

尝试跑步

男人autofs

查看关于此内容的文档。

相关内容