找回密码
 注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

广告位招租qq41463402
查看: 2|回复: 0

[系统教程] CentOS下如何查看一个文件的硬链接数?

[复制链接]

4364

主题

1293

回帖

1万

积分

知府

UID
17297
金钱
0 点
威望
0 点
贡献
-26903 点
宣传
0 人
买家
0 元
卖家
0 元
注册时间
2017-11-23
最后登录
2025-3-18

活力无限勋章

发表于 2025-6-28 13:37 | 显示全部楼层 |阅读模式

CentOS下如何查看一个文件的硬链接数?-1.jpg

方法如下:

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

[root@localhost tmp]# ls -li

total 104

229415 drwxr-xr-x 2 root root 4096 Dec 11 21:15 etc

39757 -rw-r--r-- 2 root 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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|富贵论坛 ( 琼ICP备2022019866号-7 )

GMT+8, 2025-7-5 21:54 , Processed in 0.118795 second(s), 13 queries , Redis On.

Powered by FGLT.ME

© 2001-2025 FUGUILUNTAN FGLTNET

快速回复 返回顶部 返回列表