Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • How can I change your script, so that instead of hardlinking it, it will just delete the duplicate files and will add an entry to a CSV file the deleted file -> Lined File. . ??? Commented Jan 12, 2013 at 12:17
  • Sure. The hard link line: echo ln -f "$OLDFILE" "$NEWFILE" Just replaces the duplicate file with a hard link, so you could change it rm the $NEWFILE instead. Commented Jan 13, 2013 at 4:15
  • and how on next line, write in some text file somehow $OLDFILE-> NEWFILE ??? Commented Jan 13, 2013 at 13:12
  • Ahh, right. Yes, add a line after the rm such as: echo "$NEWFILE" >> /var/log/deleted_duplicate_files.log Commented Jan 14, 2013 at 19:28
  • 2
    Don't friggin reinvent the wheel. There are more mature solutions available, like rdfind, that works at native speeds and just requires brew install rdfind or apt-get install rdfind to get installed. Commented Jan 3, 2015 at 13:46