Score:0

How to delete files in destination folder that are already present in source folder

br flag

I got two folders, a source S with files (and subfolders and so on):

  • a.txt
  • b.txt
  • c.txt
  • ...

and a destination folder D with files:

  • a.txt
  • b.txt
  • b1.txt
  • c.txt
  • c2.txt
  • ...

and I want to delete all files in D that are already present in S, so that D contains just files that are not present in S.

Any ideas, how I can achieve this with standard tools (rsync, robocopy, ...)?

P.S.: In real world S is about 800GB and contains 4*10^6 files and D is about 802GB and contains 4.1X10^6 file spread across the whole subtree.

P.P.S.: Yes, I can do some programming (bash, batch, ...), but I don't want to reinvent the wheel and want to check the (possibly) obvious first.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.