Sample Header Ad - 728x90

How to delete all duplicate hardlinks to a file?

10 votes
6 answers
7548 views
I've got a directory tree created by rsnapshot, which contains multiple snapshots of the same directory structure with all identical files replaced by hardlinks. I would like to delete all those hardlink duplicates and keep only a single copy of every file (so I can later move all files into a sorted archive without having to touch identical files twice). Is there a tool that does that? So far I've only found tools that find duplicates and *create* hardlinks to replace them… I guess I could list all files and their inode numbers and implement the deduplicating and deleting myself, but I don't want to reinvent the wheel here.
Asked by n.st (8388 rep)
May 31, 2016, 02:21 PM
Last activity: May 19, 2022, 09:25 AM