[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: find dangling symlinks



try cleanlinks

On 6/20/06, Michael Marsh <michael.a.marsh@gmail.com> wrote:
On 6/20/06, Johannes Zellner <johannes@zellner.org> 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 debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: