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

Re: using diff command



* Curtis Vaughan <curtis@npc-usa.com> [20030318 15:24 PST]:
> I must be really stupid, so forgive me, but I can't figure out for the 
> life of me how to use the diff command. I've read the man pages and 
> looked at some stuff on the internet, but I can't get it to do what I 
> want it to do.  But then maybe it doesn't do what I want it to do.
> 
> Basically, the issue is this, I have 2 files: File1 File2
> 
> Both are text files. File1 was File2 a day ago. Since then File2 has had 
> additional information tagged on to it (it's a log file). All I want to 
> see is what information has been added since yesterday.  So, I would 
> think that "diff File2 File1" should provide me with that information. 
> But all I ever get is a message that the files differ.  I have tried 
> with various arguments, but no luck.

Probably you're getting "Binary files file1 and file2 differ".

You say they're text files, but diff thinks they're not (it
sees some non-ascii characters in there).  You can convince diff to
display you the full output anyway by using 'diff -a file1 file2'.
Otherwise diff tries to not whack your terminal by throwing binary
garbage at it.  If they're just text files with a few 8-bit chars thrown
in, that should work fine.  If you're trying to diff gzipped files or
something, you'll have to use other means (e.g. zdiff in this case).

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
Microsoft has argued that open source is bad for business, but you
have to ask, "Whose business? Theirs, or yours?"     --Tim O'Reilly

Attachment: signature.asc
Description: Digital signature


Reply to: