Question for Unix guru's - diff command

calbear2000

Golden Member
Oct 17, 2001
1,027
0
0
Hi,
I have 2 gigantic files I'd like to diff. After diff runs for a few minutes, I get "diff: files too big, try -h"


I was thinking of dividing each file into 2 halves so that I can diff each half at a time. Is there a way to break up a file without manually going in with a text editor to cut and paste?

Thanks
 

calbear2000

Golden Member
Oct 17, 2001
1,027
0
0
Excellent... the split command. Thanks Bootprint

"Oh mighty unix, is there anything you can't do?"
 

manly

Lifer
Jan 25, 2000
12,760
3,552
136
I'm surprised diff cares how long the files are. Another way of doing this would be to compute a hash of each file, and compare the hashes.

The command md5sum is common on many UNIX systems; MD5 is a de facto standard for computing cryptographic hashes (although it's somewhat being deprecated in favor of SHA).

Go Bears! ;)
 

ggavinmoss

Diamond Member
Apr 20, 2001
4,798
1
0
Originally posted by: manly
I'm surprised diff cares how long the files are. Another way of doing this would be to compute a hash of each file, and compare the hashes.

The command md5sum is common on many UNIX systems; MD5 is a de facto standard for computing cryptographic hashes (although it's somewhat being deprecated in favor of SHA).

Go Bears! ;)

Wouldn't this only help if he wanted to distinguish if the files were different and not HOW they were different?

-geoff
 

manly

Lifer
Jan 25, 2000
12,760
3,552
136
Originally posted by: ggavinmoss

Wouldn't this only help if he wanted to distinguish if the files were different and not HOW they were different?

-geoff
Yes, but most times people don't diff any text files larger than a few Kbytes in size for the actual deltas. Gargantuan files are typically binary of course.

Since he mentioned a text editor, I suppose it's (remotely) possible he's interested in the actual differences between two "gigantic" files.