微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CentOS下查看一个文件的硬链接数

用ls -l 可以看到有一个文档的硬链接数:

[root@localhost tmp]# ls -li
total 104
229415drwxr-xr-x2root root 4096 Dec 11 21:15 etc
39757-rw-r--r--2root root 1602 Oct 30 14:56 hl_passwd

用一下语句可以查看一个文件有哪些硬链接


[root@localhost tmp]# find / -inum 39757
find: /proc/6266/task/6266/fd/4: No such file or directory
/etc/passwd
/tmp/hl_passwd

但是注意由于硬链接是不能跨文件系统的,所以
Add the `-xdev' option if you are starting the
search at a directory that has other filesystems mounted on it,

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。