Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么我的linux服务器中的每个文件夹目录都有. 和 .. 具有相同文件的目录?是用户错误还是设计使然?
示例:我有包含这些文件列表的文件夹 Bladelogic 以及 . 和 .. 包含相同文件的目录。
.指当前目录并..指父目录。这是设计使然。
.
..
这是设计使然。.指当前目录,并..指当前目录“上方”的目录。具体来说,假设您在一个目录/foo/bar/wizzle中。如果您ls在那里执行 an ,您会看到., 指的是/foo/bar/wizzle,而 a..指的是/foo/bar。您可以通过运行来检查这一点ls .(这将给您与 just 相同的结果ls)ls ..并将显示您的内容
/foo/bar/wizzle
ls
/foo/bar
ls .
ls ..