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

learn more… | top users | synonyms

22
votes
6answers
16k 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 ...
10
votes
10answers
17k 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 ...
3
votes
2answers
432 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 ...
1
vote
1answer
199 views

Incremental Backups of ntfsclone Images

I am attempting to make compressed incremental backups of a Windows partition using ntfsclone on Linux. Currently, I am making full ntfsclone images using something like the following command: sudo ...
0
votes
1answer
102 views

Ungroup diff's output

I've got two files, and output of diff looks like this: 33428,33429c33428,33429 < lucid-security|main|icedtea-6-jre-cacao|6b20-1.9.2-0ubuntu1~10.04.1 < ...
86
votes
6answers
131k 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 ...
12
votes
4answers
11k 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 ...
21
votes
4answers
27k 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 ...
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 ...
11
votes
6answers
442 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 ...
5
votes
1answer
3k 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 ...
2
votes
2answers
785 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 > ...
1
vote
2answers
1k views

Diff and ignore lines missing in one file

I want to diff two files and ignore lines that are present in one file but missing in the other. For example File1: foo bar baz bat File2: foo ball bat I'm currently running the following diff ...
2
votes
3answers
4k views

How can I get diff to show only added and deleted lines

How can I get the unix command diff show only added and deleted lines? If diff can't do it, what tool can?
1
vote
2answers
101 views

compare two directory trees

I have two music libraries, one a newer version than the other. I would like to compare them to figure which files I need to copy from new music tree to old. I have tried diff --brief -r ...
1
vote
1answer
237 views

Complete file system diff

I have a program which I need to install on top of Windows 8. Trouble is, the program makes changes to a few files which make another program not work, chances are that registry settings are involved, ...
0
votes
1answer
154 views

diff ignoring eol and whitespace

I would like to diff two files, such that end of lines and white space be ignored. Namely, I would like diff to find no difference between d1.txt and d2.txt: $ cat d1.txt ...