diff is a shell command to find differences between two files. It is common on all *nix based systems

learn more… | top users | synonyms

73
votes
7answers
110k views

How do I compare binary files in Linux?

I need to compare two binary files and get the output in the form <fileoffset-hex> <file1-byte-hex> <file2-byte-hex> for every different byte. So if file1.bin is 00 90 00 11 in binary ...
41
votes
2answers
16k views

Ignore .svn when doing `diff -r`

diff has an option --recursive (-r) to do a comparison between two directories (the files inside them). Is there a way to make diff ignore certain sub-directories (eg: .svn)? $ diff -r src1/ src2/
20
votes
7answers
32k views

Binary Diff Tools On Windows

I have two different binary files, and I want to compare their difference. Is there a free GUI based binary diff tool that is available on Windows?
19
votes
4answers
24k views

How do I do a binary diff on two identically sized files under Linux?

I have two identically sized files, and I need to do a binary diff to check whether they're the same. I'm currently runnnig diff file1.img file2.img but it's taking quite a while to process my ...
18
votes
6answers
9k views

Alternative for WinMerge in Ubuntu

I need to compare/diff/merge files in an easy way. In windows I would use WinMerge. What alternatives for this are available in Ubuntu? The things I must be able to do: See 2 files line by line ...
18
votes
6answers
14k views

How can I diff two XML files?

On Linux, how could I generate a diff between two XML files? Ideally, I would like to be able configure it to some things strict, or loosen some things, like whitespace, or attribute order. I'll ...
17
votes
3answers
8k views

How to Use WinMerge as the Diff tool for Mercurial

I'm using the Mercurial distributed version control system, and I'm wondering how I can configure it to use WinMerge instead of its own internal diff tool. I've already got WinMerge as the merge ...
17
votes
4answers
10k views

vimdiff: Jump to next difference inside line?

vimdiff is very handy for comparing files. However, I often use it on files with long lines and relatively few differences inside the lines. vimdiff will correctly highlight differences inside a line ...
14
votes
3answers
2k views

How can I enable colored output for OSX diff?

I need to diff two files (not two versions of the same file, they are however tracked by git, but that is unrelated) and I would like some colored output, how can I achieve that? $ diff file_1 file_2 ...
13
votes
1answer
6k views

Listing lines from just one file in DIFF

I would like to get (GNU)DIFF to printout only lines that are different in one file. So given ==> diffa.txt <== line1 line2 - in a only line3 line4 changed line5 ...
12
votes
2answers
5k views

How to diff file names in two directories (without writing to intermediate files)?

I am trying to do something along the lines of: diff `ls -1a ./dir1` `ls -1a ./dir2` But that doesn't work for obvious reasons. Is there a better way of achieving this (in 1 line), than this? ls ...
12
votes
3answers
7k views

How to diff large files on Linux

I'm getting a diff: memory exhausted error when trying to diff two 27 GB files that are largely similar on a Linux box with CentOS 5 and 4 GB of RAM. This is a known problem, it seems. I would expect ...
11
votes
6answers
412 views

Line-length-tolerant XML diff

I've looked at the answers to this question, and unfortunately none of them has helped me so far. Not to beat about the bush, the second edition of C# in Depth is now in copy edit. I want to be able ...
10
votes
4answers
10k views

How to diff directories for different files, but not line-by-line

I want to see, recursively, files that are different in two directories. Diff can do this, but it shows me the line-by-line differences, which I don't want. Is there a tool that does this, or a way to ...
9
votes
10answers
15k views

What program to use to compare big files under Windows?

I'd like to compare two files under Windows, each about 1Gb in size. I tried Total Commander and WinMerge and both ended with Out of memory error. I'm running Vista Home Premium 64bit with 8GB of RAM ...
9
votes
2answers
844 views

Is there any way to find similar files (not duplicates)?

My final goal is refactoring code written by my coworkers. So, is there a tool which can find files differing in only few words? (Edit: this is for a Mac, but others might like non-Mac answers too.)
8
votes
3answers
1k views

How to ignore whitespace in Kaleidoscope (diff tool)?

In Kaleidoscope, how do I configure it to ignore whitespaces?
8
votes
1answer
3k views

WinMerge and Diffmerge

I prefer Winmerge to Diffmerge. But the one thing I envy is diffmerge's folder diff feature. Diffmerge shows, for complecate folders and subfolders, only different files(not folders). Winmerge shows ...
8
votes
2answers
3k views

interactive/visual merge tool for console?

I'm a big fan of meld - a visual diff and merge tool for Gnome. It shows two files (or directories) side by side with their differences highlighted and I can easily select which parts I want to move ...
7
votes
3answers
4k views

Binary diff/patch for large files on linux?

I've got two partition images (A and B) and want to use them to create a patch that I can apply on A on another computer in order to get the new B image without flooding the network. I have the ...
7
votes
1answer
2k views

how can I tell vimdiff to ignore whitespace?

I made a number of changes in a file I'm working on, including indentation changes. I'm using vimdiff to compare the file to the original version, and I don't want to see these changes, since they're ...
7
votes
3answers
4k views

Prevent diff from checking for newline at end of file

I have two big trees, which I want to compare. Some of the files in the tree differ just because one has newline at the end, and the other file lacks this newline. I want to ignore this fact. I have ...
7
votes
5answers
5k views

How can I compare two directories, one being a remote directory?

I want to compare two directories, one is local and the other is on another machine. How can I do that? Can I do it with diff?
7
votes
4answers
1k views

svn diff including annotate/blame-alike information of when changes were made by who

Can you add annotate/blame-alike information to svn diff, so that for every changed line it includes which user and revision changed that line? For example, an annotate-diff comparing revisions 8-10 ...
7
votes
1answer
4k views

How can I diff two network dumps from tcpdump or Wireshark?

I'm having a problem with one of our customers' embedded computers. They seem to discard some network packets which they should not. I can capture the TCP communication from a managed switch outside ...
6
votes
5answers
7k views

Is there any free *.diff file viewer?

Is there any free software that will run on Windows 7 to show syntax highlighting for *.diff files generated from comparing files? I don't want to compare files, just view the highlighted output from ...
6
votes
4answers
1k views

Pass the output of ls to diff

I have one file that contains a list of files from a server, and a local folder that I compare to that manifest. Obviously, I do 'ls -1 > listing_local' and then diff that file with listing_server. ...
6
votes
3answers
7k views

GUI tool for applying patch files for windows

There any number of good GUI diff-tools for windows (I use Araxis Merge, and kDiff3), but none of them (that I can find) will apply a patch file. I would expect it to work like this: I open a base ...
5
votes
4answers
7k views

Windows Command Line Binary Diff Tools

does anyone know of any windows command line diff tools that are free? I need to compare two binary files and see if they are different or not. Im not interested in how they are different i just need ...
5
votes
2answers
918 views

Vimdiff and git all at once

I use vimdiff as my difftool with git. Let's say that I've changed twelve files. The problem is that sometimes I run git diff and around the fourth or fifth file I see something that I want to ...
5
votes
1answer
2k views

How do you get Eclipse's built-in diff tool to ignore differences in whitespace?

I'm working on a large codebase that's been touched by many hands. As I work through bugs, I've been converting the source to be more readable which involves a lot of minor changes in indentation ...
5
votes
1answer
2k views

Microsoft Word 2007 diff

Does Word 2007 come with diff functionality? If not, what's the easiest way of creating a patch file between two documents showing the changes I have made?
5
votes
1answer
7k views

How can Powershell on Windows 7 diff two files?

Can Powershell on Windows 7 diff two files on the hard drive? Sometimes a text compare is helpful, but otherwise just telling whether a file is identical to another file is helpful. thanks. Update: ...
5
votes
1answer
92 views

How to determine segments of footage held in common between different video files?

Context: Say I have two video files--rips from a DVD or DV tape. They are both MKV or AVI format, some standard container or other, but were ripped separately, with different encoders, different ...
5
votes
3answers
3k views

How to ignore moved lines in a diff

I am currently working on a source code generation tool. To make sure that my changes do no introduce any new bugs, a diff between the output of the program before and after my changes would ...
5
votes
2answers
311 views

“diff” terabyte files

Are there any tools that allow to "diff" text files of terabyte size?
4
votes
4answers
742 views

Tools for diffing two pages / files in a browser

I want to be able to diff the source of two pages, or even plain text files that are open in two browser windows. The only thing I can find is the PageDiff plugin for Firefox, but is there anything ...
4
votes
1answer
2k views

Use Meld instead of Kompare in KdeSVN

i tried using Meld as external diff in KdeSVN as meld -on - (settings>configure kdesvn>diff&merge) but Meld complains that the usage is wrong: meld: error: no such option: -o Finished Usage: ...
4
votes
1answer
5k views

Can I use an replace internal diff in Total Commander with an external diff program?

Since I don't really like Total Commander's internal diff 'Compare Contents' used in Compare by content and Synchronize Dirs -> Compare left & right I want to use something else like Winmerge or ...
4
votes
1answer
228 views

Diff between two directories and keep only the unchanged ones

I need to diff two directories: A: /path1/ B: /path2/ The directory A contains all files and subdirectories that are also contained in B. The files in A (and in its subdirectories) can have ...
4
votes
5answers
8k views

How do you compare multiple folders with same files to find all different versions of the same file?

I've got 700+ folders with the same set of 200+ classic asp files (basically text files) in each folder. Over the years various people have made minor changes inside these asp files. I need an utility ...
4
votes
4answers
3k views

Checking whether binary files are the same? [duplicate]

Possible Duplicate: Binary Diff Tools On Windows What would be the easiest way of veryfying whether two binary files are the same, without actually opening them, checking versions and such ...
4
votes
3answers
548 views

Is there any graphical display tool for diff output?

I would like to post-process diff output and then pass the results to a graphical viewer, such as kdiff3 or xxdiff. If possible, I would like to be able to highlight in-line differences using ...
4
votes
3answers
696 views

Diff 2 files while ignoring parts of lines

I would like to diff a file system. Currently my bash script prints out the file system recursively into a file (ls -l -R) and diffs it with an expected output. An example for a line in this file ...
3
votes
3answers
2k views

Diff in bash script?

I've been toying around with makefiles and bash scripts and I'm interested in this: Is it possible to get a boolean value from a diff(or something similar) so that I can use it in a bash script to ...
3
votes
4answers
2k views

Similarity and/or Diff of two ODT documents (Linux)

I have two ODT documents, they have very close contents, I want to compare them to see how similar they are. The best would be to have a similarity percentage, if not possible, an alternative would ...
3
votes
3answers
617 views

Verifying successful file transfer after moving lots of large files

I'm working on transferring a lot of files (>100GB, several thousands of files) over my network to a new Mac. Once the transfers are done I'd like to be able to verify that all of the files were ...
3
votes
3answers
840 views

Using diff on a long one line file

I have a file that has only one line. Its size is about 20,000 bytes. The file has been modified, and I wanted to know where. I thought using diff, but it shows me the complete line, because it ...
3
votes
4answers
2k views

Is there a diff utility that allows you to exclude columns?

For example, I have a text file, each line is a long string. I want to exclude 2 "segments" of this string, say columns 1-7 and 20-22. So the bottom 2 lines below would be a match: ...
3
votes
4answers
1k views

Tool for comparing a single line of text

Is there a tool for comparing two lines of text? All the tools I have compare on a line level, when I really need a character level diff in the line. Windows or *nix, GUI or command line, I don't ...