{"id":4164,"date":"2015-01-27T19:18:35","date_gmt":"2015-01-27T11:18:35","guid":{"rendered":"http:\/\/rmohan.com\/?p=4164"},"modified":"2015-01-27T19:18:35","modified_gmt":"2015-01-27T11:18:35","slug":"how-to-find-dead-links-and-delete-them","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=4164","title":{"rendered":"How to find dead links and delete them"},"content":{"rendered":"<p>Sometimes, after performing VPS migrations, the soft links in \/etc\/vz\/conf may not be removed.  Over time, the dead links may build up and cause many &#8216;No such file or directory&#8217; messages when trying to look for common settings amonst all conf files (ie cat \/etc\/vz\/conf\/*.conf  | grep whatever).<br \/>\nQuick easy way to delete these dead links:<\/p>\n<p>~# cd \/etc\/vz\/conf<br \/>\n~# for f in `find . -type l ! -exec test -r {} \\; -print`; do rm -f $f; done<\/p>\n<p>One liner:<\/p>\n<p>~# find -L -type l -exec rm -f {} \\;<br \/>\n* Please test before issuing these commands on production systems!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, after performing VPS migrations, the soft links in \/etc\/vz\/conf may not be removed. Over time, the dead links may build up and cause many &#8216;No such file or directory&#8217; messages when trying to look for common settings amonst all conf files (ie cat \/etc\/vz\/conf\/*.conf | grep whatever). Quick easy way to delete these dead [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4164"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4164"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4164\/revisions"}],"predecessor-version":[{"id":4165,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4164\/revisions\/4165"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}