CentOS下如何查看一個文件的硬鏈接數(shù)

admin Linux運維評論718字數(shù) 387閱讀模式

方法如下:
用ls -l 可以看到有一個文檔的硬鏈接數(shù):

[root@localhost tmp]# ls -li文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

total 104文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

229415 drwxr-xr-x 2 root root 4096 Dec 11 21:15 etc文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

39757 -rw-r–r– 2 root root 1602 Oct 30 14:56 hl_passwd文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

用一下語句可以查看一個文件有哪些硬鏈接文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

[root@localhost tmp]# find / -inum 39757文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

find: /proc/6266/task/6266/fd/4: No such file or directory文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

/etc/passwd文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

/tmp/hl_passwd文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

但是注意由于硬鏈接是不能跨文件系統(tǒng)的,所以文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

Add the `-xdev' option if you are starting the文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

search at a directory that has other filesystems mounted on it文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html 文章源自網(wǎng)吧系統(tǒng)維護-http://www.ykday.cn/7794.html

版權(quán)聲明:文章圖片資源來源于網(wǎng)絡,如有侵權(quán),請留言刪除!!!
廣告也精彩
admin
  • 本文由 發(fā)表于 2021年9月29日 09:42:17
  • 轉(zhuǎn)載請務必保留本文鏈接:http://www.ykday.cn/7794.html
匿名

發(fā)表評論

匿名網(wǎng)友 填寫信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: