Skip to main content

Questions tagged [diff]

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

475 votes
18 answers
867k 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 ...
user avatar
110 votes
10 answers
106k 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 ...
qedi's user avatar
  • 1,621
38 votes
11 answers
87k views

How can I compare big files under Windows? [closed]

I'd like to compare two files under Windows, each about 1Gb in size. I tried Total Commander and WinMerge, but both ended with Out of memory errors. I'm running Vista Home Premium 64bit with 8GB of ...
Piotr Dobrogost's user avatar
18 votes
5 answers
13k views

Is there a way to access files from one WSL 2 distro/image in another one?

I have several Unbuntu WSL 2 "installations" on my Windows 10 system and I'd like to be able to run tools like rsync and diff between them. Is it possible to mount/find where the files for ...
intel_chris's user avatar
67 votes
13 answers
64k views

Linux: Compare Directory Structure Without Comparing Files

What is the best and simplest way to compare two directory structures without actually comparing the data in files? This works fine: diff -qr dir1 dir2_ But it's really slow because it's comparing ...
Jonah's user avatar
  • 935
44 votes
6 answers
40k 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 ...
Tom B's user avatar
  • 441
23 votes
4 answers
23k 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 ...
thejh's user avatar
  • 1,437
14 votes
6 answers
1k 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 ...
Jon Skeet's user avatar
  • 5,144
12 votes
3 answers
32k views

How do I compare two folders recursively and generate a list of files and folders that are different?

tl;dr and an example I'm looking for a way to compare two folders recursively and output the relative paths all files (and folders) that are different (by size or by timestamp, à la rsync). For ...
Andrew Cheong's user avatar
3 votes
2 answers
4k views

Tool for diffing large files

When I use "diff" to find the difference between two large data files, diff A.txt B.txt > dif.info it is output: diff:memory exhausted or add the argument "-H" diff -H A.txt B.txt > dif....
Dong's user avatar
  • 43
60 votes
7 answers
91k views

How to print files that would have been changed using rsync?

Is there a way to get rsync to print the full filepaths to all files that are different without actually transferring any files? Alternatively, I need a way to diff the files across two trees (over ...
Joe Tsai's user avatar
  • 609
54 votes
7 answers
30k 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 ...
miphe's user avatar
  • 1,019
41 votes
5 answers
73k 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 4 ...
Jon Cage's user avatar
  • 2,607
27 votes
2 answers
31k views

How to diff only the first line of two files?

I want to diff only the first line of two files, as opposed to the entire file. How would I do that? I only need a solution for the the first line, but if you could specify the number of lines that ...
gsgx's user avatar
  • 1,033
22 votes
2 answers
15k views

Get recursive list of different files in Winmerge (without folder tree/structure)

I prefer Winmerge to Diffmerge, but the one thing I envy is Diffmerge's folder diff feature. Diffmerge shows, for complicated folders and subfolders, only different files (not folders). Winmerge ...
Benjamin's user avatar
  • 2,309

15 30 50 per page