[lug] replacing dupes with links

Kevin Fenzi kevin at scrye.com
Wed Mar 14 10:49:23 MDT 2018


On 03/12/2018 02:22 PM, mad.scientist.at.large at tutanota.com wrote:
> For organizational purposes i'm trying to deal with a partition that has many copies of each file in various subdirectories.  I'd like a way to replace all but one instance of a given file with a link.  Is there an easy way to do this?  I'm thinking i can use fdupes and some scripting.  Any better ideas or already written shellscripts or programs? 
> 
>  The partition has several hundred gig of files (several hundered thousand files including dupes) nicely sorted and grouped but consuming excess space.  Run time isn't much of an issue as this machine can run unattended overnight.  I could use fslint with a lot of user involvement but obviously that would be tedious.
> 

If you don't mind hard links you could use the hardlink program.

https://pagure.io/hardlink

"hardlink traverses one or more directories searching for duplicate
files.  When it finds duplicate files, it uses  one  of  them  as the
master.  It then removes all other duplicates and places a hardlink for
each one pointing to the master file.  This allows for conservation of
disk space where  multiple  directories  on  a single filesystem contain
many duplicate files."

kevin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20180314/86681a89/attachment.sig>


More information about the LUG mailing list