fazineroso fazineroso - 23 days ago 9
Linux Question

given two directory trees how to find which files are the same?

I am writing a bash script, and I would like to know which files are the same in two directory trees.

It would be the opposite of using diff.

Well i found the answer myself. I had tried it before, but I thought it did not work.

diff -srq dir1/ dir2/ | grep identical

Answer

Well i found the answer myself. I had tried it before, but I thought it did not work.

diff -srq dir1/ dir2/ | grep identical