[CentOS] Locating the broken links

Thu Jan 31 15:54:31 UTC 2008
Christian Volker <cvolker at vmware.com>

Hi,

> Any pretty way to find broken links on the entire filesystem would be 
> welcome however.

I have a script available for this:

#!/bin/bash
# command line parameter would be the directory to search

for i in ` find $1 -type l `; do
        # feststellen, ob der link noch gueltig ist oder nicht
        file $i | grep -q broken
        if [ $? -eq 0 ] ; then
                echo "Broken link $i"
        fi
done
exit


Christian Volker

Technical Support Engineer
-- 
Parnell House, Barrack Square, Ballincollig, Co. Cork, Ireland