Compare files with different names in different directories

Hi,

I have a requirement to compare files in different directories with different names. The files have a datestamp in their name (It might not be a sequential datetimestamp).
This is for Redhat Linux. I have more than 5 directories and more than 10 file in each directory to be compared.

/Directory1
       f1.txt.04012015
       f2.txt.04012015
       f3.txt.04012015
/Directory2
       f1.txt.04022015
       f2.txt.04022015
       f3.txt.04022015
/Directory3
       f1.txt.04032015
       f2.txt.04032015
       f3.txt.04032015

So far I have written a shell script to do this in a very simple manner - But i think there has to be a better way

diff Directory1/f1.txt.04012015 Directory2/f1.txt.04022015
diff Directory1/f2.txt.04012015 Directory2/f2.txt.04022015
...
..

We could make lots of assumptions about whether or not the names of the files in your various directories are all the same, what is supposed to happen if some files don't appear in some directories but do appear in others, what shell you're using, how you want the output presented, etc.

Why don't you show us the script you have now, and tell us what needs to be changed to get what you want out of it?

Hi.

See find same size file for a demonstration of utilities fdupes and rdfind

Best wishes ... cheers, drl

Sorry for the late reply

Don,

Names of the files in various directories will be same except for the datetime appended at the end of the files. All the files will appear in all the directories. I can use the BASH shell or the basic shell or KSH. I am just trying to get a "Diff" from the similar files in different directories. Output will be similar to the "diff" command. The script i have curently is as shown in my original post - List of "diff" commands will actual files-names for all the files.

/usr/bin/diff Directory1/f1.txt.04012015 Directory2/f1.txt.04022015 
/usr/bin/diff Directory1/f2.txt.04012015 Directory2/f2.txt.04022015
...
...

In your first post in this thread, you said you had a shell script that produced a script of the diff commands you wanted to execute, and you showed us the 1st two lines of output from that script.

Show us that script; not its output! It will help us understand what your directory structure really looks like, what files need to be compared, what you want done if expected files are missing, ... ... ... Without seeing your working script, there are just too many details that you haven't specified to be able to be of much help; unless you just want us to waste our time trying to guess at your requirements.