Questions tagged [diff]

Short for "difference" or "differencing", in computing, "diff" refers to a data comparison that calculates and displays the differences between two objects (usually files or directories).

97 questions
208
votes
16 answers

How do diff over ssh?

How do I diff files/folders across machines provided that the only connectivity available is ssh?
Alexey Timanovsky
  • 3,391
  • 3
  • 18
  • 8
96
votes
10 answers

How can I get diff to show only added and deleted lines? If diff can't do it, what tool can?

How can I get diff to show only added and deleted lines? If diff can't do it, what tool can?
C. Ross
  • 2,995
  • 8
  • 32
  • 36
91
votes
4 answers

Difference between `curl -I` and `curl -X HEAD`

I was watching the funny server type from http://www.reddit.com with curl -I http://www.reddit.com when I guessed that curl -X HEAD http://www.reddit.com would do the same. But, in fact, it doesn't. I'm curious about why. This is what I observe…
chmeee
  • 7,270
  • 3
  • 29
  • 43
36
votes
3 answers

compare 2 directories and copy differences in a 3rd directory

Running ubuntu 12.04, I want to compare 2 directories, say folder1/ and folder2/ and copy any files that are different to folder3/. There are also nested files, so matching subdirectories should be copied as well Is there a single command that…
periklis
  • 421
  • 1
  • 4
  • 9
32
votes
5 answers

Does btrfs have an efficient way to compare snapshots?

While diffing mounted snapshots would work, it sounds like it could be horribly slow in many cases. Is there btrfs specific functionality for diffing snapshots? (I was unable to find any in the docs)
Catskul
  • 1,839
  • 4
  • 20
  • 23
25
votes
7 answers

Get rsync to generate a patch file instead of copying across files?

I'm copying lots of files that have changed from one server to another using rsync. I know I can use the -n option to do a dry run, so I can see what files have been changed. However is it possible to get rsync to print a diff of the file contents…
Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
24
votes
6 answers

How do I prove two files are the same legally?

We had someone steal some files before quitting and it has eventually come down to a lawsuit. I've now been provided with a cd of files and I have to "prove" that they are our files by matching them to our files from our own file server. I don't…
reconbot
  • 2,435
  • 3
  • 25
  • 30
17
votes
7 answers

How to compare two directories (including sub directories) for differences?

How can I compare two directories with sub dirs to see where is the difference?
alexus
  • 12,342
  • 27
  • 115
  • 173
15
votes
11 answers

How can I diff two config files?

I've got two snmpd.conf files, one on a server that works, and one that doesn't. How can I diff the two config files while stripping out irrelevant comments and newlines?
jldugger
  • 14,122
  • 19
  • 73
  • 129
14
votes
5 answers

How do I diff two folders in Windows Powershell?

I'm trying to find differences in the content of two folder structures using Windows Powershell. I have used the following method to ensure that the file names are the same, but this method does not tell me if the contents of the files are the…
David Smith
  • 249
  • 1
  • 2
  • 7
13
votes
4 answers

Linux tools to find duplicate files?

I have a large and growing set of text files, which are all quite small (less than 100 bytes). I want to diff each possible pair of files and note which are duplicates. I could write a Python script to do this, but I'm wondering if there's an…
Daryl Spitzer
  • 2,946
  • 9
  • 33
  • 40
11
votes
5 answers

Apply multiple .patch files

I have a directory with .patch files, generated using diff. I would like to apply all those patches using patch -p1 to another directory. But patch takes only one file, unless I cat. What would the command be to apply multiple files using xargs or a…
styts
  • 235
  • 1
  • 2
  • 6
10
votes
1 answer

Identifying the number of changed bytes between two ZFS snapshots of the same file

Let's assume I have a ZFS filesystem that contains virtual machine disk images, e.g. /tank/examplevm/examplevm-flat.vmdk Let's further assume I take daily snapshots of that ZFS filesystem, e.g. $ zfs snapshot tank@20120716 $ zfs snapshot…
nlx-ck
  • 415
  • 3
  • 7
8
votes
2 answers

debian, diff, config default

I want to know if is posible to get the diff on the original versus the current config files of installed debian packages. If found an answers which shows up the modified config files, but I find no way to generate the diff. The command…
Neoecos
  • 183
  • 3
8
votes
1 answer

Is there a command that produces a diff of the permissions of target files?

Just as it sounds, I'm trying to find out if there is a (standard) command that will produce a diff of the permissions between two files and/or directory trees. Ideally it would put out a patch file that could be used to change permissions to match…
Catskul
  • 1,839
  • 4
  • 20
  • 23
1
2 3 4 5 6 7