[ILUG] symbolic link trasher...

Philip Reynolds phil at redbrick.dcu.ie
Thu Jun 29 10:41:23 IST 2000


John P. Looney (Kate)'s [jplooney-ilug at online.ie] 13 lines of dribble included:
:> Is there a handy way of deleting all dead symbolic links ? I think I
:>remember there being a single command that used to ship with slackware...

You can do with a bit of sh and a bit 'o perl.

#!/bin/sh
find . -type l -print | perl -nle '-e || print'

It'll list all of them. Save the file as "deadlinks" or something and
rm `deadlinks`
Phil.




More information about the ILUG mailing list