I have two directories. dir1 and dir2.
In dir1 files are: abc.txt, abd.txt, abe.txt, abf.txt
In dir2 files are: abi.txt, abd.txt, abe.txt, abg.txt, abh.txt
abd.txt and abe.txt are present in both directories and are having different contents. How to write a script which will return only these two file name? I dont want files which are missing in dir1 or dir2. I only need file names which has same names and are having different contents.
Thank you in advance.