[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find inodes of a dir
From: |
Andrei Enshin |
Subject: |
find inodes of a dir |
Date: |
Sat, 15 Aug 2020 18:40:42 +0300 |
Hello,
I’m trying to identify all hard links pointing to my root directory:
$ sudo ls -lid /
2 drwxr-xr-x 23 root root 4096 Aug 11 20:58 /
The inode number is 2 and count of hard links is 23.
Then I run find:
$ sudo find / -xdev -inum 2 2>/dev/null | wc -l
15
But the `find` finds only 15.
I checked on two different systems and result of find doesn’t match the number
of hardlinks.
In detailed out — https://pastebin.com/raw/JH6hW7n6 — you can see that -xdev
option seems to be ignored since /dev is counted.
But it is still doesn’t explain why the number is 15 — less than 23.
May I ask for help to find all hard links to the directory within one
filesystems using `find`?
---
Best Regards,
Andrei Enshin
- find inodes of a dir,
Andrei Enshin <=