具有两个点前缀的目录名称是什么意思?

问题描述 投票:0回答:2

我在Linux系统中获得了以下文件层次结构。想知道在目录名称前添加两个点是什么意思?

/run/mydir # ls -la
total 4
drwxrwxrwt    3 root     root           140 Sep 22 13:03 .
drwxr-xr-x    3 root     root          4096 Sep 30 06:26 ..
drwxr-xr-x    2 root     root           100 Sep 22 13:03 ..2019_09_22
lrwxrwxrwx    1 root     root            31 Sep 22 13:03 ..data -> ..2019_09_22
lrwxrwxrwx    1 root     root            13 Sep 22 13:03 address -> ..data/address
lrwxrwxrwx    1 root     root            16 Sep 22 13:03 name -> ..data/name
lrwxrwxrwx    1 root     root            12 Sep 22 13:03 cell -> ..data/cell

/run/mydir # ls -la ../
total 8
drwxr-xr-x    3 root     root          4096 Sep 30 06:26 .
drwxr-xr-x    3 root     root          4096 Sep 30 06:26 ..
drwxrwxrwt    3 root     root           140 Sep 22 13:03 mydir
/run/mydir #
linux shell ls
2个回答
0
投票

总是有两个默认目录。

单个句点(。)=当前目录双倍(..)=父目录


0
投票

没有任何意义,只不过ls通常不会列出名称,因为第一个字符是点.。要看到以点开头的名称,您需要显示ls -a或其附近。看起来像一个约定,在您的计算机上具有root特权的人喜欢以此作为标识其他目录的方式,但这仅是全部。

我们可以推测,随着时间的流逝,最终可能会出现其他目录,例如..2019_09_29,并且可能会操纵..data指向当前正在分析的目录,但这只是猜测。

© www.soinside.com 2019 - 2024. All rights reserved.