• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Question for Unix guru's - diff command

calbear2000

Golden Member
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
 
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! 😉
 
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
 
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.
 
Back
Top