waffel’s Weblog

Januar 8, 2015

find and remove dead links in linux

Filed under: administration — Thomas Wabner @ 1:17 pm

I asked myself the question, what would be the best way under Linux to find and remove dead links?

Here is the short answer (only tested on bash):

find . -type l -exec sh -c "file -b {} | grep -q ^broken" \; -print | tr "\n" "" | xargs -0 rm

Erstelle kostenlos eine Website oder ein Blog auf WordPress.com.