在 bash 下执行下面命令看看结果是什么
cd /tmppwdcd //tmppwdcd ///tmppwdcd ////tmppwd/tmp//tmp/tmp/tmp貌似中间混入了一个奇怪的东西,这是什么玩意?? 我们来看看它的 inodestat //tmp 文件://tmp 大小:740 块:0 IO 块:4096 目录设备:2dh/45d Inode:12972 硬链接:17权限:(1777/drwxrwxrwt) Uid:( 0/ root) Gid:( 0/ root)最近访问:2019-09-16 21:52:50.368212128 +0800最近更改:2019-09-16 22:29:22.768083948 +0800最近改动:2019-09-16 22:29:22.768083948 +0800创建时间:-可以看到 inode 为 12972,那么这个 inode 其实应该属于哪个文件呢?
find / -inum 12972;:/tmp你会发现其实就是,怎么会这样呢?根据的规范An implementation may further simplify curpath by removing any trailing <slash> characters that are not also leading <slash> characters, replacing multiple non-leading consecutive <slash> characters with a single <slash>, and replacing three or more leading <slash> characters with a single <slash>. If, as a result of this canonicalization, the curpath variable is null, no further steps shall be taken.