{"id":646,"date":"2011-01-11T19:21:19","date_gmt":"2011-01-11T18:21:19","guid":{"rendered":"https:\/\/thebc.ch\/blog\/?p=646"},"modified":"2013-02-01T13:00:26","modified_gmt":"2013-02-01T12:00:26","slug":"find-identical-files","status":"publish","type":"post","link":"https:\/\/thebc.ch\/blog\/?p=646","title":{"rendered":"Find identical files"},"content":{"rendered":"<div dir=\"ltr\">\n<pre>OUTF=rem-duplicates.sh; echo \"#! \/bin\/sh\" &gt; $OUTF; find \"$@\" -type f -print0 | xargs -0 -n1 md5sum | sort\r\n--key=1,32 | uniq -w 32 -d --all-repeated=separate | sed -r 's\/^[0-9a-f]*( )*\/\/;s\/([^a-zA-Z0-9.\/_-])\/\\\\\\1\r\n\/g;s\/(.+)\/#rm \\1\/' &gt;&gt; $OUTF; chmod a+x $OUTF; ls -l $OUTF<\/pre>\n<\/div>\n<div dir=\"ltr\">\n<pre>OUTF=rem-duplicates.sh;\r\necho \"#! \/bin\/sh\" &gt; $OUTF;\r\nfind \"$@\" -type f -print0 |\r\n  xargs -0 -n1 md5sum |\r\n    sort --key=1,32 | uniq -w 32 -d --all-repeated=separate |\r\n    sed -r 's\/^[0-9a-f]*( )*\/\/;s\/([^a-zA-Z0-9.\/_-])\/\\\\\\1\/g;s\/(.+)\/#rm \\1\/' &gt;&gt; $OUTF;\r\nchmod a+x $OUTF\r\nls -l $OUTF<\/pre>\n<\/div>\n<p>Original article: <a title=\"http:\/\/elonen.iki.fi\/code\/misc-notes\/remove-duplicate-files\/\" href=\"http:\/\/elonen.iki.fi\/code\/misc-notes\/remove-duplicate-files\/\" rel=\"nofollow\">http:\/\/elonen.iki.fi\/code\/misc-notes\/remove-duplicate-files\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>OUTF=rem-duplicates.sh; echo &#8220;#! \/bin\/sh&#8221; &gt; $OUTF; find &#8220;$@&#8221; -type f -print0 | xargs -0 -n1 md5sum | sort &#8211;key=1,32 | uniq -w 32 -d &#8211;all-repeated=separate | sed -r &#8216;s\/^[0-9a-f]*( )*\/\/;s\/([^a-zA-Z0-9.\/_-])\/\\\\\\1 \/g;s\/(.+)\/#rm \\1\/&#8217; &gt;&gt; $OUTF; chmod a+x $OUTF; ls -l $OUTF &hellip; <a href=\"https:\/\/thebc.ch\/blog\/?p=646\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[27],"class_list":["post-646","post","type-post","status-publish","format-standard","hentry","category-bash","tag-oneliners"],"_links":{"self":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=646"}],"version-history":[{"count":8,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/646\/revisions"}],"predecessor-version":[{"id":2690,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/646\/revisions\/2690"}],"wp:attachment":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}