Tag Info

Hot answers tagged

53

Add --exclude=".svn" as an option like so: $ diff -r --exclude=".svn" src1/ src2/


50

This will print the offset and bytes in hex: cmp -l file1.bin file2.bin | gawk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}' Or do $1-1 to have the first printed offset start at 0. cmp -l file1.bin file2.bin | gawk '{printf "%08X %02X %02X\n", $1-1, strtonum(0$2), strtonum(0$3)}' Unfortunately, strtonum() is specific to GAWK, so you ...


30

As ~quack (hehe) pointed out: % xxd b1 > b1.hex % xxd b2 > b2.hex And then % diff b1.hex b2.hex or % vimdiff b1.hex b2.hex


29

cmp is designed to find differences in binary files. You might also try checksumming (sum) and compare the hashes.


24

One approach would be to first turn both XML files into Canonical XML, and compare the results using diff. For example, xmllint can be used to canonicalize XML. $ xmllint --c14n one.xml > 1.xml $ xmllint --c14n two.xml > 2.xml $ diff 1.xml 2.xml


21

Meld (alternative link) Meld is a visual diff and merge tool. You can compare two or three files and edit them in place (diffs update dynamically). You can compare two or three folders and launch file comparisons. You can browse and view a working copy from popular version control systems such such as CVS, Subversion, Bazaar-ng and Mercurial. Look at the ...


21

From the TortoiseHg FAQ: Add these lines to your personal Mercurial.ini file [extdiff] cmd.winmerge = C:\Program Files\WinMerge\WinMerge.exe opts.winmerge = /e /x /ub /wl Now run the Global Settings tool. On the TortoiseHg tab, you should see winmerge available in the drop-down list for Visual Diff Command. Select winmerge, apply, then close. ...


21

What about diff -rq DIR1 DIR2 or diff -rqb DIR1 DIR2 -r is recursive -q is for brief, and will just tell you if the files are different (i.e., it won't show the line-by-line differences) -b ignores whitespace


17

There's a tool called DHEX which may do the job, and there's another tool called VBinDiff. For a strictly command-line approach, try JDIFF.


16

You were close. In bash you want process substitution, not command substitution: diff <(ls -1a ./dir1) <(ls -1a ./dir2)


15

Not sure diff alone can do it but you can always use the power of other GNU utilities to help you. diff -u diffa.txt diffb.txt | grep '^-[^-]' | sed 's/^-//' It does the diff, then selects only the lines that begins with '-' - those are changed and have values from diffa.txt file, then sed just remove those '-' signs. Edit: After few experiments with ...


13

WinMerge - (free, Windows), accoriding to the Wikipedia article is currently dormant (doesn't mean much if it works and is stable/complete) http://diffchecker.com/diff - (Web) - I was able to upload two binary files and compare Beyond Compare - (paid, Windows/Linux) - I strongly recommend Beyond Compare as it is my favourite file comparison tool and I'm ...


11

set diffopt+=iwhite from vim wikia


11

If you're after a graphical diff command, you should give Meld a go. It's a visual diff and merge tool. I think it is present by default on Ubuntu systems


11

I like diffuse: Diffuse is a graphical tool for merging and comparing text files. Diffuse is able to compare an arbitrary number of files side-by-side and gives users the ability to manually adjust line-matching and directly edit files. Diffuse can also retrieve revisions of files from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, Subversion, and SVK ...


11

Perl has a a lackluster colordiff wrapper for diff, but I prefer grc (generic colorizer). With grc (generic colorizer), you can write your own wrappers for different types of commands or inputs (if you like that sort of thing). Below, grc is running against /var/log/syslog (in the config, this file is set to a certain color scheme), where it highlights ...


10

You basically need to compare two files, conditionally ignoring the trailing byte. There isn't a 'diff' option to do this -- but there are a number of ways it could be done (e.g, hex diff comes to mind as well.) To use 'diff', you basically have to modify the files that are missing the newline at the end of a file, and then compare. You could create a ...


10

One of the fields in the gzip header is different between the two files. One such field is the last modified time of the compressed file (in seconds since 1970), or if the compressed data was not read from a file, then the time when the file was compressed. Even a one second difference is enough to make the gzip files not match.


10

One of the most common ways of determining if two files are identical (assuming their sizes match) is using a program to create a "hash" (essentially a fingerprint) of a file. The most common ones are md5sum and sha1sum. For example: $ md5sum file1 file2 e0e7485b678a538c2815132de7f9e878 file1 4a14aace18d472709ccae3910af55955 file2 If you have many ...


9

Did you try the built-in compare functionality? Edit / Compare Document... If you just want a textual diff, your best bet is probably to convert both documents to plain text, then run a regular diff on them. You will have to figure out how to normalize linebreaks though, otherwise the diff will not be very useful.


9

If all you need is a byte-by-byte comparison, use cmp: if cmp -s "$a" "$b"; then echo Same else echo Differ fi This avoids wasting time for diff's difference finding algorithm.


8

In Eclipse, go to Window > Preferences. Then search for "patch" and click on General > Compare/Patch. Check Ignore white space. Now only the details that matter in the diff will show up.


8

Found a solution - the cmp tool which comes with most Linux flavours.


8

diff --exclude=.svn ...


8

Looks like SourceGear DiffMerge will give you this, with its ruleset support for XML (and lots of other languages). I'm not sure if it will fix all your problems, because the example is of course a simplification of the actual program. I tried slightly more complex changes, and those seem to work fine too. See the sample below for the diff you described


8

What about just using fc or comp? Both are included in Windows and should have no problems handling large files. In fact, 1 GiB is actually a pretty small file.


8

Use the comp command under cmd.exe [C:\]comp /? Compares the contents of two files or sets of files. COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C] [/OFF[LINE]] data1 Specifies location and name(s) of first file(s) to ...


7

On the Review tab, there's an option to compare documents and merge them into one:


7

You should probably take a look at the rsync-related tools: rdiff and rdiff-backup. The rdiff command lets you produce a patch file and apply it to some other file. The rdiff-backup command uses this approach to deal with entire directories, but I'm guessing you're working with single-file disk images, so rdiff will be the one to use.


6

So easy :) In Winmerge, go to menu View and uncheck "Tree mode"



Only top voted, non community-wiki answers of a minimum length are eligible