LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-22-2005, 02:12 PM   #1
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
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
 
Old 09-22-2005, 02:34 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
cd /<target>
find -exec diff "{}" /<origin/"{}" \;



Cheers,
Tink
 
Old 09-22-2005, 02:45 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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...
 
Old 09-22-2005, 02:47 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Cheers,
Tink
 
Old 09-22-2005, 02:54 PM   #5
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Original Poster
Rep: Reputation: 30
well thanks anyway Tinkster i was looking for that way as my version of *cough* AIX doesnt have --brief.

Thanks to both of you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing 2 Files for Duplicates Mr_H Linux - Newbie 5 11-09-2005 12:43 PM
Using diff for comparing 2 files beep Programming 5 01-21-2005 12:51 PM
Comparing files contents? hhegab Linux - Newbie 3 07-01-2004 12:45 AM
Comparing 2 Files xianzai Programming 2 05-23-2004 11:50 AM
Comparing files on creation time StarTux Programming 2 08-29-2003 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration