{"id":2918,"date":"2013-09-09T11:02:35","date_gmt":"2013-09-09T11:02:35","guid":{"rendered":"http:\/\/www.webputzer.com\/?p=2918"},"modified":"2018-09-06T05:15:37","modified_gmt":"2018-09-06T05:15:37","slug":"perl-code-to-find-files-of-a-certain-type","status":"publish","type":"post","link":"http:\/\/www.webputzer.com\/?p=2918","title":{"rendered":"Code to find files of a certain type and copy"},"content":{"rendered":"<p>You can use the following code to find files of a certain type, on Linux, and copy all of them to a new location.  In the example below all &#8220;.tar&#8221; files are copied to \/newfolder:<\/p>\n<pre>\r\nfind \/root -iname \"*.tar\" -execdir cp '{}' \/newfolder\/ \\;<\/pre>\n<h2>Updated<\/h2>\n<p>Slightly different syntax which, as I recall, works on newer versions of Linux:<\/p>\n<pre>find \/usr\/share -name '*.png' -exec cp  {} \/home\/guy\/PNG \\;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can use the following code to find files of a certain type, on Linux, and copy all of them to a new location. In the example below all &#8220;.tar&#8221; files are copied to \/newfolder: find \/root -iname &#8220;*.tar&#8221; -execdir cp &#8216;{}&#8217; \/newfolder\/ \\; Updated Slightly different syntax which, as I recall, works on newer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2950,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"footnotes":""},"categories":[21],"tags":[],"class_list":["post-2918","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/2918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2918"}],"version-history":[{"count":0,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/2918\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/media\/2950"}],"wp:attachment":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2918"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}