find -L . -type l -delete

Eugene Grosbein eugen at kuzbass.ru
Thu Nov 13 06:17:30 PST 2008


On Thu, Nov 13, 2008 at 03:38:51PM +0200, Andriy Gapon wrote:

> Am I stupid or is our 'find' is seriously broken in one subtle feature?
> 
> $ find -L . -type l
> find all broken symlinks (target doesn't exists)
> 
> $ find -L . -type l -delete
> removes all symlinks!!!

Yes.

> FreeBSD 7.1-PRERELEASE amd64

This is pretty old and known problem:
http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/90687

Eugene Grosbein


More information about the freebsd-stable mailing list