LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   comparing lots of files (https://www.linuxquestions.org/questions/linux-general-1/comparing-lots-of-files-366007/)

Frustin 09-22-2005 02:12 PM

comparing lots of files
 
i am copying a truck load of files from one fs to another (gigs)

i want to know how i can either:

...make diff check though the whole fs and just tell me at the end that they ARE all the same.

or

...make diff tell me that one of the files is NOT the same.

cheers

Tinkster 09-22-2005 02:34 PM

cd /<target>
find -exec diff "{}" /<origin/"{}" \;



Cheers,
Tink

Dark_Helmet 09-22-2005 02:45 PM

Not to confuse, but diff can recurse too. I did the same thing when moving files around. The command I used was:
Code:

diff --recursive --brief /path/to/dir1 /path/to/dir2
With "--brief" diff will only output when files are different. Specifically, it'll say something to the effect of "/path1/file1 and /path2/file2 differ" or it'll tell you if a file exists in one directory but not the other...

Tinkster 09-22-2005 02:47 PM

Heh - that's what I love about Linux, I learn something
everyday! :) ... I wasn't aware of recursion in diff.


Cheers,
Tink

Frustin 09-22-2005 02:54 PM

well thanks anyway Tinkster i was looking for that way as my version of *cough* AIX doesnt have --brief.

Thanks to both of you.


All times are GMT -5. The time now is 12:58 PM.