From the command line run the following command:
for file in directory1/*; do diff "$file" "directory2/${file##*/}"; done
or for specific file types (example for txt files):
for file in directory1/*.txt; do diff "$file" "directory2/${file##*/}"; done