On 6/20/06, Michael Marsh <[EMAIL PROTECTED]> wrote:
On 6/20/06, Johannes Zellner <[EMAIL PROTECTED]> wrote:
> how do I find dangling symlinks?
$ find -L <path> -type l
should do it. "-L" tells find to follow symlinks, and "-type l"
(that's a lowercase ell) matches symlinks. Since the only symlinks
that will show as symlinks when they're automatically dereferenced are
ones pointing to nothing, you should get a list of dangling links.
I tested this out, and it worked as desired, but it's possible that
there might be cases where it breaks. In particular, long chains of
symlinks break, and I haven't checked to see if those match.
--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]