什么是双点(..)和单点(。)在Linux? [英] What is double dot(..) and single dot(.) in Linux?

查看:158
本文介绍了什么是双点(..)和单点(。)在Linux?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ls -ai 命令显示 .. 它们的inode分别与当前目录和父目录相同。

The ls -ai command shows that . and .. have their inodes same as current directory and parent directory, respectively.

任何人都可以告诉我究竟什么是 .. 是?

Could anyone tell me what exactly . and .. are?

他们是真实的文件甚至硬链接?但是如我所知,不允许创建一个到目录的硬链接。

Are they real files or even hard links? But as I have known, it's not allowed to create a hard link to a directory.

推荐答案

他们是特殊的名称尽管它们不是真正的硬链接,但它确实算作硬链接(它们确实增加了链接数),因为正如你所说,目录不能有硬链接。在这里阅读更多:硬链接和Unix文件系统节点(inode)

They are special name-inode maps which do count as hard-links (they do increase the link-count) though they aren't really hard-links, since, as you said, directories can't have hard-links. Read more here: Hard links and Unix file system nodes (inodes)

这篇关于什么是双点(..)和单点(。)在Linux?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆