diff --git a/doc/tips/finding_duplicate_files/comment_15_cd191275a277aee5de80507d5b5da69b._comment b/doc/tips/finding_duplicate_files/comment_15_cd191275a277aee5de80507d5b5da69b._comment new file mode 100644 index 0000000000..cf1c7212e0 --- /dev/null +++ b/doc/tips/finding_duplicate_files/comment_15_cd191275a277aee5de80507d5b5da69b._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="chris@a3ac8acdfdc53fa269c7b9bda4306c25b92d6624" + nickname="chris" + avatar="http://cdn.libravatar.org/avatar/eb7f91e7b7b3457ca57701a40f920f2a" + subject="Files with spaces" + date="2019-02-19T14:04:04Z" + content=""" +For anyone dealing with files with spaces, try this: + +``` +git annex find --include '*' --format='${escaped_file} ${escaped_key}\n' | \ + sort -k2 | uniq --all-repeated=separate -f1 | \ + sed 's/ [^ ]*$//' +``` + +Using `escaped_file` escapes the filename, which will avoid whitespace so the rest of the pipe commands work correctly. You'll need to deal with the files being escaped in the final output, but you'll see them correctly. This worked for me. +"""]] diff --git a/doc/tips/finding_duplicate_files/comment_16_05827cf95647c56c344d150564cdf01d._comment b/doc/tips/finding_duplicate_files/comment_16_05827cf95647c56c344d150564cdf01d._comment new file mode 100644 index 0000000000..45aa9e8e4a --- /dev/null +++ b/doc/tips/finding_duplicate_files/comment_16_05827cf95647c56c344d150564cdf01d._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="CandyAngel" + avatar="http://cdn.libravatar.org/avatar/15c0aade8bec5bf004f939dd73cf9ed8" + subject="comment 16" + date="2019-02-19T14:13:48Z" + content=""" +As the key never contains spaces, it is better to have the key first. Then the filename is anything after key(plus separator) up to the newline. +"""]]