Take /etc
dir as example. On my system it has 144 links. And as dir's can't have hardlinks (this is my understanding), the number 144
should refer to softlinks (1 original + 143 softlinks).
$ ll -i
total 84
2 drwxr-xr-x 20 root root 4096 Aug 18 01:21 ./
2 drwxr-xr-x 20 root root 4096 Aug 18 01:21 ../
12 lrwxrwxrwx 1 root root 7 Aug 18 01:19 bin -> usr/bin/
1048577 drwxr-xr-x 4 root root 4096 Sep 1 15:53 boot/
5636097 drwxr-xr-x 2 root root 4096 Aug 18 01:21 cdrom/
2 drwxr-xr-x 23 root root 4920 Sep 3 11:20 dev/
262145 drwxr-xr-x 144 root root 12288 Sep 3 09:34 etc/
I am trying to trace the softlinks (out of curiosity and to learn in advance for any future uses) but having no luck.
I tried -
$ sudo find / -not -path "/mnt/*" -samefile /etc
/etc
find: ‘/run/user/1000/doc’: Permission denied
...
-lname
to find "softlinks" to some file or directory, rather than that tricky and limiting-L -samefile
contraption. – Sep 03 '20 at 08:31-lname
matches link names exactly, so it misses anything that skips around using..
or uses a link containing directories. – Stephen Kitt Sep 03 '20 at 08:52-lname
can’t find. Could you explain why-L -samefile
is limiting? – Stephen Kitt Sep 03 '20 at 09:08