{"id":1375,"date":"2017-12-18T05:28:06","date_gmt":"2017-12-17T20:28:06","guid":{"rendered":"https:\/\/www.dogrow.net\/linux\/?p=1375"},"modified":"2022-07-18T06:33:55","modified_gmt":"2022-07-17T21:33:55","slug":"blog70","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/linux\/blog70\/","title":{"rendered":"(70) <span class=\"my_fc_deeppinkB\">find<\/span>\u3067\u30b5\u30a4\u30ba0\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u51fa"},"content":{"rendered":"<h1 class=\"my_h\">(1) \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u300c\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\uff1d\uff10\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u51fa\u3057\u3001\u524a\u9664\u3057\u305f\u3044\u3002<\/p>\n<h1 class=\"my_h\">(2) \u5b9f\u73fe\u65b9\u6cd5<\/h1>\n<p>find\u30b3\u30de\u30f3\u30c9\u3092 size\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u3067\u5b9f\u884c\u3059\u308b\u3002<br \/>\n\u691c\u51fa\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092 rm\u30b3\u30de\u30f3\u30c9\u3067\u524a\u9664\u3059\u308b\u3002<\/p>\n<pre class=\"my_pre\">\r\nfind . -type f <span class=\"my_fc_deeppinkB\">-size 0<\/span> | xargs rm\r\n<\/pre>\n<p>xargs\u3092\u4f7f\u308f\u305a exec\u30aa\u30d7\u30b7\u30e7\u30f3\u3067 rm\u3092\u5b9f\u884c\u3057\u3066\u3082\u3088\u3044\u3002<\/p>\n<pre class=\"my_pre\">\r\nfind . -type f <span class=\"my_fc_deeppinkB\">-size 0<\/span> -exec rm {} \\;\r\n<\/pre>\n<p class=\"my_fc_crimsonB\">{} \u304c\u691c\u51fa\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u306b\u7f6e\u304d\u63db\u308f\u308b\u3002<br \/>\n\u6700\u5f8c\u306f \\; \u3067\u9589\u3058\u308b\u3002<\/p>\n<p>\u53c2\u8003\u307e\u3067\u306b\u3001man\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u8aac\u660e\u306e\u8a72\u5f53\u7b87\u6240\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"my_pre_bgBlack\">\r\n-size n[cwbkMG]\r\n  File uses n units of space, rounding up.  The following suffixes can be used:\r\n\r\n  `b'    for 512-byte blocks (this is the default if no suffix is used)\r\n\r\n  `c'    for bytes\r\n\r\n  `w'    for two-byte words\r\n\r\n  `k'    for Kilobytes (units of 1024 bytes)\r\n\r\n  `M'    for Megabytes (units of 1048576 bytes)\r\n\r\n  `G'    for Gigabytes (units of 1073741824 bytes)\r\n\r\n  The size does not count indirect blocks, but it does count blocks in sparse files that are not actually allocated.  Bear in\r\n  mind that the `%k' and `%b' format specifiers of -printf handle sparse files differently.  The `b'  suffix  always  denotes\r\n  512-byte  blocks  and  never  1  Kilobyte blocks, which is different to the behaviour of -ls.  The + and - prefixes signify\r\n  greater than and less than, as usual, but bear in mind that the size is rounded up to the next unit (so a  1-byte  file  is\r\n  not matched by -size -1M).\r\n<\/pre>\n<h1 class=\"my_h\">\u305d\u306e\u4ed6<\/h1>\n<p>size\u30aa\u30d7\u30b7\u30e7\u30f3\u306f &gt; \u3068 &lt; \u3082\u6307\u5b9a\u3067\u304d\u308b\u3002<\/p>\n<h3 class=\"my_h\">1) 30[KB]\u3092\u8d85\u3048\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22<\/h3>\n<pre class=\"my_pre\">\r\nfind . -type f -size +30k\r\n<\/pre>\n<h3 class=\"my_h\">2) 10[MB]\u672a\u6e80\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22<\/h3>\n<pre class=\"my_pre\">\r\nfind . -type f -size -10M\r\n<\/pre>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>(1) \u3084\u308a\u305f\u3044\u3053\u3068 \u300c\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\uff1d\uff10\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u51fa\u3057\u3001\u524a\u9664\u3057\u305f\u3044\u3002 (2) \u5b9f\u73fe\u65b9\u6cd5 find\u30b3\u30de\u30f3\u30c9\u3092 size\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u3067\u5b9f\u884c\u3059\u308b\u3002 \u691c\u51fa\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092 rm\u30b3\u30de\u30f3\u30c9\u3067\u524a\u9664\u3059\u308b\u3002 find . -typ\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/linux\/blog70\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-1375","post","type-post","status-publish","format-standard","hentry","category-find"],"views":12063,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/1375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/comments?post=1375"}],"version-history":[{"count":13,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/1375\/revisions"}],"predecessor-version":[{"id":3510,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/1375\/revisions\/3510"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/media?parent=1375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/categories?post=1375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/tags?post=1375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}