Script to compare two directories and delete duplicates


pappaq

Recommended Posts

Hey there,

 

I hope I am at the right place for this question.

 

My question is:

I need a script that compares two folders and deletes the duplicates in the second folder. This only needs to happen at folder level.

 

/mnt/user/temp/folder1/...

/mnt/user/temp/folder2/... <-- delete duplicate folders and files in the folders

 

I don't trust myself to do it, since it involves deleting possibly thousands of folders.

 

Could anybody help me, please?

 

cheers

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.