How to know the level of a symlink in linux?

Posted by ??? on Super User See other posts from Super User or by ???
Published on 2010-06-08T07:39:57Z Indexed on 2010/06/08 7:42 UTC
Read the original article Hit count: 188

Filed under:
|

For example, if a symlink

a -> b
b -> c
c -> d

say, the symlink level of a is 3.

Then, is there any utility to get this info? And, also I want to get the expansion detail of a symlink, which will show me something like:

1. /abc/xyz is expanded to /abc/xy/z (lrwx--x--x root root)
2. /abc/xy/z is expanded to /abc/xy-1.3.2/z (lrwx--x--x root root)
3. /abc/xy-1.3.2/z is expanded to /abc/xy-1.3.2/z-4.6 (lrwx--x--x root root)
4. /abc/xy-1.3.2/z-4.6 is expanded to /storage/121/43/z_4_6 (lrwx--x--x root root)
5. /storage/121/43/z_4_6 is expanded to /media/kitty_3135/43/z_4_6 (lrwx--x--x root root)

So I can diagnostic with the symlinks. Any idea?

© Super User or respective owner

Related posts about linux

Related posts about symbolic-link