HOWTO Find broken symbolic links – Gentoo Linux Wiki
HOWTO Find broken links – Gentoo Linux Wiki
I was trying to find some broken links. however, although using
find . -type l
shows all links, it does nto use the cool flashing RED that BASH can do to shwo a broken links. So doing a quick Google turned me to this Gentoo howto: Nice n easy!
find . -type l | (while read FN ; do test -e "$FN" || ls -ld "$FN"; done)





easier
find -L . -type l -lname ‘*’
April 13th, 2007 at 1:21 pm. Permalink.
thanks. Will try that.
Cheers
Ferg
April 14th, 2007 at 6:24 pm. Permalink.
This seems a bit more direct:
find -L . -type l
May 1st, 2007 at 1:11 am. Permalink.
“find -L” follows sym links
so it goes out of ./ dir
October 22nd, 2008 at 11:58 am. Permalink.
[...] to the “Ferg’s Gaff” blog (especially the comments) for showing the way [...]
November 29th, 2008 at 7:58 pm. Permalink.
To also show what the broken links used to point to:
find -L Documents -type l -ls
- or -
find -L Documents -type l -exec ls -l “{}” \;
- or -
find -L Documents -type l -exec ls -l –color “{}” \; ## colorized
December 21st, 2008 at 7:22 am. Permalink.
find -L . -type l
gives me an error message:
find: invalid predicate `-L’
June 21st, 2009 at 6:45 pm. Permalink.
broken link search without pipe:
find . -type l ! -execdir test -e ‘{}’ \; -print
August 31st, 2009 at 10:06 pm. Permalink.
er, better off without the ‘ because your blog seems to turn it into the UTF-8 quotes:
find . -type l ! -execdir test -e {} \; -print
August 31st, 2009 at 10:07 pm. Permalink.