2

I'm trying to recursively diff 2 directories with lots of hierarchy/files within them. It's overwhelming to parse through the results.

What I'd like is a simple summary report that shows what's in one directory but not the other. I can write a simple perl script to do it, but wondering if I'm missing some obvious solution.

Edit: I found this thread: Given two directory trees, how can I find out which files differ? and something like this seems to work:

diff --brief -r dir1/ dir2/ |grep -v differ
Community
  • 1
  • 1
Joe Suh
  • 21
  • 2

2 Answers2

1

You're not using diff?

diff <(find dirA | sort) <(find dirB | sort) >bigdiff
tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Thanks. I also found this thread: http://stackoverflow.com/questions/4997693/given-two-directory-trees-how-can-i-find-out-which-files-differ – Joe Suh Apr 12 '13 at 21:06
0

Try this scriptlet (modified tripleee's answer)

diff <(find prod/ | sort | cut -d"/" -f2- ) <(find test/ | sort| cut -d"/" -f2-)

The cut removes the directory names themselves in my case "prod" and "test" Tip: Add the -y to see a side by side view

SidJ
  • 669
  • 12
  • 29