Removing links to missing files


You have many symbolic links that point to missing files.

I guess it is all just about good housekeeping! 🙂 Well and the fact your application might break, depending on something being there, that is not.



This bit of shell under example tab, deals with them swiftly and sharply. 🙂

Effectively it just does a find from the current directory, then loops around looking for missing files.



for na in `find . -type l`
ls -lLd $na 2>&1 | grep "No such file" |
while read junk delme junk
rm ${delme%:}



[tags]symbolic links, find, rm, while, UNIX Coding School[/tags]


If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

Your email address will not be published. Required fields are marked *