{"id":659,"date":"2010-07-20T15:33:43","date_gmt":"2010-07-20T20:33:43","guid":{"rendered":"http:\/\/abrammorphew.com\/notes\/?p=659"},"modified":"2010-07-20T15:33:43","modified_gmt":"2010-07-20T20:33:43","slug":"i-found-the-f-mtime-3","status":"publish","type":"post","link":"http:\/\/abrammorphew.com\/notes\/2010\/07\/20\/i-found-the-f-mtime-3\/","title":{"rendered":"I found the F (-mtime +3)!"},"content":{"rendered":"<p>forgetting is the bane of my existence. don&#8217;t ask why. i&#8217;ve forgotten this syntax enough times that i should have it tattooed on my upper arm. in fact, I think i&#8217;ve posted it on my own site before and forgotten about that. <\/p>\n<pre class=\"brush:bash\">\r\nfind \/path\/to\/files* -mtime +5 -exec rm {} \\;\r\n<\/pre>\n<p>the first argument is, of course, the path to the files that you&#8217;re looking to rid yourself. The first flag, <em>-mtime<\/em>, tells <em>find<\/em> to look for files older than a certain number of days. the whole &#8220;+5&#8221; would indicate five days from today (would -5 be five days in the future then? something to look up later). The second flag, <em>-exec<\/em>, will tell find to execute the following command when it gets a positive result. in this case, we&#8217;re &#8220;removing&#8221; (<em>rm<\/em) files. the curly brackets then send the found files as input to the command, and we kill the thing with a terminating \"\\;\"! \n\ni will say though that i should really read the man page a little better to get this straight. this particular command has yielded some strange results at times, and i'm at a loss as to why being that it's SO straight forward. maybe i'll just post the man page here for shits and giggles. \n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>forgetting is the bane of my existence. don&#8217;t ask why. i&#8217;ve forgotten this syntax enough times that i should have it tattooed on my upper arm. in fact, I think i&#8217;ve posted it on my own site before and forgotten about that. find \/path\/to\/files* -mtime +5 -exec rm {} \\; the first argument is, of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[74,36,37,72,73],"class_list":["post-659","post","type-post","status-publish","format-standard","hentry","category-notes","tag-admin","tag-bash","tag-find","tag-linux","tag-unix"],"_links":{"self":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/comments?post=659"}],"version-history":[{"count":1,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/659\/revisions"}],"predecessor-version":[{"id":660,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/659\/revisions\/660"}],"wp:attachment":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/media?parent=659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/categories?post=659"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/tags?post=659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}