waffel’s Weblog

Januar 8, 2015

find and remove dead links in linux

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

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

Kommentar verfassen »

Du hast noch keine Kommentare.

RSS feed for comments on this post. TrackBack URI

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit deinem WordPress.com-Konto. Abmelden /  Ändern )

Facebook-Foto

Du kommentierst mit deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s

Bloggen auf WordPress.com.

%d Bloggern gefällt das: