0
Solution

Find broken symlinks and delete them

Find broken symlinks and delete them

Look for the broken link, and  list them:

#find -L /path -type l

Delete broken link

#find -L /path -type l -delete

To delete with confirmation do:

#find -L /path -type l -exec rm -i {} +

L flag follows symlinks, so the -type l test only returns true if the link can’t be followed, or is a symlink to another broken symlink.

You Might Also Like...

No Comments

    Leave a Reply