[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: diff files matching a pattern



Mark Neidorff wrote:
Excuse me. I don't want to appear rude, but are you a student at Cornell and are we doing your CS homework for you?

Excuse me. I don't want to appear rude, but you could have foud it out yourself had you bothered to visit the OP's webpage/blog mentioned in his signature.

You appear to be relatively new here. Please see:
1. http://www.debian.org/MailingLists/#codeofconduct
2. http://www.netmeister.org/news/learn2quote.html


On Sunday 24 February 2008 02:21 pm, Kamaraju S Kusumanchi wrote:
Let's say I have two directories dir1, dir2 each with 1000 files.
Of these 1000 files in each directory, there are 50 files named file1.txt,
file2.txt ... file50.txt. The rest of the files do not follow any pattern
and are very large in size.

Now is there any way to compare

dir1/file1.txt and dir2/file1.txt
dir1/file2.txt and dir2/file2.txt
....
dir1/file50.txt and dir2/file50.txt


Manually diffing the files 50 times is cumbersome. Something like

diff dir1/file*.txt dir2/file*.txt

is what I am after. I do not want to do

diff -r dir1 dir2

since that compares the other 950 files as well besides the 50 files that I
want. Any idea how to achieve this in the most generic fashion? Has anyone
done this kind of thing before?

thanks
raju
--
Kamaraju S Kusumanchi
http://www.people.cornell.edu/pages/kk288/
http://malayamaarutham.blogspot.com/




--
Raj Kiran Grandhi
--
At the source of every error which is blamed on the computer, you will find at least two human errors, including the error of blaming it on the computer.


Reply to: