歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> CentOS下如何查看一個文件的硬鏈接數?

CentOS下如何查看一個文件的硬鏈接數?

日期:2017/3/2 16:24:59   编辑:Linux服務器

  用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,

Copyright © Linux教程網 All Rights Reserved