Broken Symlinks
I want to introduce a little command fu for reporting broken symlinks on the shell, because I found several variations while searching in the net, that were not very satisfying.
At least on my Arch Linux the following pipe did the job.
find . -type l -print0 |
LANG=C xargs -0r file |
fgrep -iw broken
I saw recommendations with -xtype l
in find
and test
instead of file
,
the results were not complete. I also tested stat
and readlink
without success.
So good old find
with -type l
and the file
command is working for me.
Looks like a generic solution to me.