0

I basically want to do what the title says. I've looked up this question several different ways, but no previous answer seems to work for me. I'm hoping for a command-line way to do this, preferably one command only. I've looked into using diff and rsync, but both compare folders when I just want to compare contents. I also have no idea on how to translate the output of diff into a command that moves the output.

My setup has two folders; one with nested folders containing mp3 files and one with just mp3 files. It looks like this:

  • Folder A
    • random folder
      • thing A
      • thing B
    • random folder 2
      • thing C
  • Folder B
    • thing A
    • thing C
    • thing D

I want the output to be:

  • Folder C
    • thing B
    • thing D

Thanks so much, I'm just making my transition to using the Unix command line, I'm sorry if certain parts don't make sense!

2
  • What shell are you using?
    – Kusalananda
    Dec 3 '19 at 7:59
  • @Kusalananda I'm using zsh.
    – Jason1923
    Dec 4 '19 at 7:06
0
diff -qr folder1 folder2 > folder3

r -> is to read the sub directory

1
  • This would create a text file, not a directory with the files that are unique in either directory.
    – Kusalananda
    Dec 3 '19 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.