Score:-1

`rm` everything in dir A that also exists in dir B

in flag
Him

I accidentally cp'd a bunch of stuff from B into A without including the folder. I.e. I copied the contents of B into A, and I meant to copy B into A to get A/B. A already had a bunch of stuff in it, so now I have to sort it all out. However, B still exists in its original location, so I can ls B to see what is in B. Can I use this info to rm the stuff in A that is also in B?

cc flag
Yes. It is trivial to use the output of ls to produce the list of files to rm -- unless you have characters like spaces and parentheses in the names which require an additional layer of quoting.
Score:0
in flag
Him

got it.

from A:

find B -maxdepth 1 -printf "%P\n" | xargs -d '\n' rm -rf

Score:0
cn flag
fdupes -d A B

fdupes is a really helpful utility for discovering and removing duplicate files.

I sit in a Tesla and translated this thread with Ai:

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.