{"id":2234,"date":"2015-04-24T08:21:23","date_gmt":"2015-04-24T15:21:23","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=2234"},"modified":"2015-04-24T09:45:14","modified_gmt":"2015-04-24T16:45:14","slug":"remove-all-the-files-in-a-directory-with-a-specific-name","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=2234","title":{"rendered":"Remove all the files in a directory with a specific name"},"content":{"rendered":"<p>I have a web app that generates temporary files as part of a shell script. The files start with &#8216;frequency&#8217; and have a hash appended. Sometimes the app doesn\u2019t clear them out. This line does it. At some point I need to put this in a cron job, but I haven\u2019t done it yet.<\/p>\n<p><pre><code class=\"preserve-code-formatting\">\nsudo find \/tmp -iname &quot;frequency*&quot; -exec rm -f {} \\;\n<\/code><\/pre><\/p>\n<p>By the way, I think the reason that the files are not cleared out is that they are generated by SpamBots. The code for clearing temporary files is on the display page. It never executes because the page that displays the results is never loaded.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a web app that generates temporary files as part of a shell script. The files start with &#8216;frequency&#8217; and have a hash appended. Sometimes the app doesn\u2019t clear them out. This line does it. At some point I need to put this in a cron job, but I haven\u2019t done it yet. sudo &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=2234\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Remove all the files in a directory with a specific name<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2234","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2234"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2234\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}