linux - 目录名前缀有两个点是什么意思?

标签 linux shell ls

我在 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 #

最佳答案

它没有任何意义,只是 ls 通常不会列出名称,因为第一个字符是点 .。要查看以点开头的名称,您需要 ls -a 或类似的内容,如您所示。它看起来像是在您的计算机上拥有根权限的人喜欢的一种约定,作为识别其他目录的方式,但仅此而已。

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

关于linux - 目录名前缀有两个点是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58172322/

相关文章:

Python selenium 脚本在几个小时后停止工作

c++ - 反汇编 C++ 可执行文件的最佳 Linux 工具

c++ - 如何将 pthread_t 映射到 pid(在 Linux 上)

linux - 作为 bash 脚本调用时如何替换命令名称?

c - parent 杀死 child 后, child 的 Linux/proc/PID 目录仍然存在

bash - 如何逐行评估流

linux - 什么时候用引号括起 shell 变量?

linux - LS 命令未在 Amazon EC2 中列出文件

linux - bash 。使用差异

c - 如何使用 `stat`通过符号链接(symbolic link)获取最终终点的路径