opposite of differ?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Given that differ compares directories - based on files added, changed, or deleted, how can I make a list of exactly the opposite - files which are the same (exist, not changed, not deleted), between source and target paths... please?
If you want to see the result graphically you can pipe a DIR of each directory to a file, and compare both files with a graphical difference tool (I use WinMerge for example).

If you want to see the result in the console, a command such as
for %f in (a\*) if exist b\%@name[%f] echo %@name[%f]
yields the names common to directories "a" and "b".