{"id":32385,"date":"2023-09-22T11:19:47","date_gmt":"2023-09-22T09:19:47","guid":{"rendered":"https:\/\/www.linuxboxen.dk\/?p=32385"},"modified":"2023-09-22T11:19:47","modified_gmt":"2023-09-22T09:19:47","slug":"find-commandoen-med-print0","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=32385","title":{"rendered":"find commandoen med -print0"},"content":{"rendered":"<p>N\u00e5r du bruger find kommandoen med -print eller print0 for at f\u00e5 listen af filer, som 1 linje er der et problem. Dennne find vil ikke virke, med mindre at de 2 fil argumenter er true.<br \/>\nfor at det skal virke p\u00e5 hver argument SKAL hver argument have -print som vist her.<\/p>\n<p>Hvis der ikke er nogle *.xz filer eller *.yaml vil denne fejle.<\/p>\n<p>$ find \/opt\/puppet\/reports -mtime +30 -name &#8220;*.yaml&#8221; -type f -o -mtime +30 -name &#8220;*.xz&#8221; -type f -print0<\/p>\n<p>Dette vil virke, da -print0 er i hver find argument.<\/p>\n<p>$ find \/opt\/puppet\/reports -mtime +30 -name &#8220;*.yaml&#8221; -type f -print0 -o -mtime +30 -name &#8220;*.xz&#8221; -type f -print0<\/p>\n<p>Fra main page.<\/p>\n<pre>The <b>-print <\/b><strong>action is performed on all files for which the whole\n       expression is true<\/strong>, unless it contains an action other than\n       <b>-prune <\/b>or <b>-quit<\/b>.  Actions which inhibit the default <b>-print <\/b>are\n       <b>-delete<\/b>, <b>-exec<\/b>, <b>-execdir<\/b>, <b>-ok<\/b>, <b>-okdir<\/b>, <b>-fls<\/b>, <b>-fprint<\/b>, <b>-fprintf<\/b>,\n       <b>-ls<\/b>, <b>-print <\/b>and <b>-printf<\/b>.\n<\/pre>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_32385\" class=\"pvc_stats all  \" data-element-id=\"32385\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.linuxboxen.dk\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>N\u00e5r du bruger find kommandoen med -print eller print0 for at f\u00e5 listen af filer, som 1 linje er der et problem. Dennne find vil ikke virke, med mindre at de 2 fil argumenter er true. for at det skal virke p\u00e5 hver argument SKAL hver argument have -print som vist her. Hvis der ikke [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_32385\" class=\"pvc_stats all  \" data-element-id=\"32385\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.linuxboxen.dk\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-32385","post","type-post","status-publish","format-standard","hentry","category-tips"],"a3_pvc":{"activated":true,"total_views":45,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/32385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32385"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/32385\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}