{"id":330,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=330"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"find-recently-modified-files","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=330","title":{"rendered":"Find recently modified files"},"content":{"rendered":"<p>The Find panel will let you build queries for all files modified after yesterday, or after last hour, etc. However, I&#8217;ve been stymied trying to ask for all files which have been modified in the last five minutes. Perhaps there&#8217;s an easy way to do it in the GUI, but since I wanted to start myself off in shell scripting, I thought I&#8217;d give that a shot. The following script does the trick :<\/p>\n<pre>\nNow=$(date +%s)\nOlder=$(expr $Now - $@)\necho Files modified in the last $@ seconds :\nquery -a '(last_modified>='$Older')'\n<\/pre>\n<p>If you paste that into a text file called <code>recent<\/code>, put it into your <code>\/boot\/home\/config\/bin<\/code> directory, and made sure it&#8217;s executable with :<\/p>\n<pre>chmod +x \/boot\/home\/config\/bin\/recent<\/pre>\n<p>Then from the terminal you can just type <code>recent 60<\/code> to get a quick list of everything modified in the last 60 seconds. Any integer parameter (within reason) should work &#8212; <code>recent 300<\/code> for five minutes, or even <code>recent 132<\/code> if for some reason you want two minutes and 12 seconds. \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Find panel will let you build queries for all files modified after yesterday, or after last hour, etc. However, I&#8217;ve been stymied trying to ask for all files which have been modified in the last five minutes. Perhaps there&#8217;s an easy way to do it in the GUI, but since I wanted to start [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[10],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","tag-scripting"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}