{"id":1159,"date":"2014-09-23T20:45:06","date_gmt":"2014-09-23T20:45:06","guid":{"rendered":"http:\/\/scunster.co.uk\/?p=1159"},"modified":"2014-09-23T20:45:06","modified_gmt":"2014-09-23T20:45:06","slug":"find-files-of-a-specific-age-date-and-then-remove-them","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=1159","title":{"rendered":"Find files of a specific age \/ date and then remove them"},"content":{"rendered":"<p>The following command will find all files with the extension *.mp3 that are 7 days old or older, it will then delete them.<\/p>\n<pre>find \/home\/music\/ -name \"*.mp3\" -mtime +7 -exec rm {} \\;<\/pre>\n<p>Change the -mtime to set how how old the files are that you want the action to apply to.<\/p>\n<p>After -exec, you can put any command you like, such as remove, rename, compress etc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following command will find all files with the extension *.mp3 that are 7 days old or older, it will then delete them. find \/home\/music\/ -name &#8220;*.mp3&#8221; -mtime +7 -exec rm {} \\; Change the -mtime to set how how old the files are that you want the action to apply to. After -exec, you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1159","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1159"}],"version-history":[{"count":1,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1159\/revisions"}],"predecessor-version":[{"id":1160,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1159\/revisions\/1160"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}