Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Where is DIR3 specified? All I see is DIR1 and DIR2. Commented Aug 20, 2013 at 23:59
  • I tried it, and (from what I can tell) the output was: all the files only in DIR1 in column 1, all the files only in DIR2 in column 2, and all the files shared by both in column 3. That's sort of useful, but do you know how one might strip out column 3 and leave only the differences? I have a lot of files to sort through, and most of it is identical. I don't need to see what's the same. Commented Aug 21, 2013 at 0:14
  • 1
    Also, I found that comm <(ls DIR1) <(ls DIR2) did not work recursively. For that I used comm <(ls -R1 DIR1) <(ls -R1 DIR2). ls -R crawls through directories recursively, and ls -1 (note that that is a one, not an L) makes ls print only one filename per line. Commented Aug 21, 2013 at 0:22
  • @Michael: comm -3 (see man comm).
    – Zaz
    Commented Jul 20, 2014 at 11:31