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).

Filter by
Sorted by
Tagged with
214 votes
16 answers
162k views

How do diff over ssh?

How do I diff files/folders across machines provided that the only connectivity available is ssh?
Alexey Timanovsky's user avatar
103 votes
11 answers
107k views

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's user avatar
  • 3,095
97 votes
4 answers
132k views

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. ...
chmeee's user avatar
  • 7,390
36 votes
3 answers
40k views

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 ...
periklis's user avatar
  • 421
36 votes
5 answers
15k views

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's user avatar
  • 1,939
25 votes
7 answers
20k views

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 ...
Amandasaurus's user avatar
  • 31.9k
24 votes
6 answers
1k views

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 ...
reconbot's user avatar
  • 2,455
17 votes
7 answers
36k views

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's user avatar
  • 13.2k
15 votes
11 answers
15k views

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's user avatar
  • 14.4k
14 votes
5 answers
33k views

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 ...
David Smith's user avatar
13 votes
4 answers
9k views

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 ...
Daryl Spitzer's user avatar
12 votes
5 answers
34k views

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 ...
styts's user avatar
  • 245
10 votes
1 answer
3k views

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. $ ...
nlx-ck's user avatar
  • 415
9 votes
1 answer
3k views

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 ...
Catskul's user avatar
  • 1,939
8 votes
1 answer
11k views

compare tar content with local folder

I want to compare the content of a tar archive (backup of $HOME) with the content of my local $HOME to see whether there are files in the tar file which are not yet in the local filesystem. What is ...
dAnjou's user avatar
  • 183
8 votes
2 answers
1k views

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 ...
Neoecos's user avatar
  • 183
7 votes
7 answers
2k views

Different files of two directories

There are two directories I'd like to compare. I tried diff but it includes the changes inside the files. All I want is something like this file a is just in /A file b is missing in /A file c ...
Wienczny's user avatar
  • 1,153
7 votes
5 answers
13k views

Comparing OS configuration of two RHEL servers

What is the best way to compare the OS configuration of two (or more) RHEL 5.X servers? Are there any tools/packages available to do this? Note, I am mostly looking for tunables OS (kernel ...
Patrick's user avatar
  • 81
6 votes
2 answers
4k views

rsnapshot diff between snapshots

I am using rsnapshot to manage incremental backups of some GNU/Linux servers. Although rsnapshot is delivered with a tool called rsnapshot-diff it just provide disk space statistics. The question is ...
Angus Macyver's user avatar
5 votes
2 answers
7k views

How to export a specific virtualbox snapshot as a raw disk image

I created a Linux appliance for my friends. It's a small Ubuntu installation with Trac, lighthttp and ufw configured. I made it using VirtualBox. Now I want to export the latest snapshot version ...
Bryan Hunt's user avatar
5 votes
1 answer
1k views

How to convert an rdiff delta file to a regular diff?

I need to diff two very large files, far too large for diff to handle. rdiff can produce a delta file for them in a few seconds, but I'd like to have a real diff as output. Is there an existing way of ...
uckelman's user avatar
  • 183
4 votes
2 answers
102 views

Only show what's new in a file

I want to find out what was added to a log file between 2 tasks. Right now the way I do it is: content of test.log initially aaa bbb saving content of the log $ cp test.log test.log.before doing ...
Max's user avatar
  • 3,553
4 votes
2 answers
1k views

How can I compare two directories to compare missing files, when the directories don't have the same structure?

I've been sent a HDD of new and updated files from an organisation that we are working with, but we already have most of the files sitting on our servers, and would like to update our local versions ...
David Dean's user avatar
4 votes
2 answers
4k views

How to create a chained differencing disk of another differencing disk in Virtual Box?

How to create a differencing disk (a chained one) from a disk that is already a differencing image? I would like to have: W2008 (base immutable) -> W2008+SQL2008 (differencing, with SQL ...
WooYek's user avatar
  • 304
4 votes
2 answers
3k views

Is there a diff/merge utility to compare binary files and synchronize data bit-by-bit in either direction based on differences in binary data?

I have a tricky dilemma. I've got some files on two different destination drives, copied from the same source drive. The source drive had been failing, so I used dd to copy over the data to one ...
purefusion's user avatar
4 votes
3 answers
4k views

Check if all files in a directory exists elsewhere

I'm about to remove an old backup directory, but before doing so I'd like to make sure that all these files exist in a newer directory. Is there a tool for this? Or am I best off doing this "manually"...
aioobe's user avatar
  • 381
3 votes
4 answers
6k views

Diff and patch for big binary files

As part of my job I regularly need to upload big files (a 512 MB to 1 GB ISO, for example). In some cases, very little changes from ISO to ISO (say, a 10 MB file in a 1 GB ISO). Unfortunately, I can't ...
ggambetta's user avatar
  • 229
3 votes
4 answers
385 views

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

I have 2 sorted files produced by xxx>find /store -type f -print | sort > /tmp/invent.txt xxx>find /fbkup -type f -print | sort > /tmp/backup.txt I want from diff a file name list of files missing ...
Andreas's user avatar
  • 31
3 votes
3 answers
6k views

How to see what Windows registry and file system changes happened after a software install?

I'm solving a problem - I'm installing software on Windows and it makes the system unstable for some reason. Windows starts crashing soon after. I want to know what changes it made to the registry and ...
Boda Cydo's user avatar
  • 405
3 votes
2 answers
5k views

Script to find out differences between local and remote file systems over SSH

I am looking for a script to find out the differences between a local and remote file systems (over SSH). Ideally the script should do the following: -browse the local file system for folders -find ...
Max's user avatar
  • 3,553
3 votes
3 answers
4k views

Compare two folder content

How can I compare two folder content under linux. I'm using diff but I want to display only the files with the same names.
Mokus's user avatar
  • 412
3 votes
1 answer
272 views

Bug in diff: wrong output for one-character files without newline [closed]

Consider this: echo -n a > /tmp/a echo -n b > /tmp/b diff -B /tmp/a /tmp/b Clearly, the two files are different, yet, diff seems to think that the files are identical. I've managed to ...
Navin's user avatar
  • 133
3 votes
3 answers
1k views

help with bash script using find and diff command

i have a bash script that i need help with: #!/bin/bash if [ -f "/suid.old" ] then find / -perm -4000 -o -perm -2000 ls > suid.old else find / -perm 4000 -o -perm -2000 ls > suid.new diff suid....
user avatar
2 votes
2 answers
7k views

How to compare/diff ACLs on two directory trees?

I have two directory trees that are supposedly copies of each other. I need to compare not the contents of files but the permissions on them. Is there a tool that will compare two dir trees but ...
DaveBurns's user avatar
  • 205
2 votes
3 answers
2k views

diff for binary files

I have a folder with one big file. This is a file that changes each day. Using tar for incremental backups is not a good idea as that big file (each file that is changed is saved) will be copied each ...
user28362's user avatar
  • 576
2 votes
3 answers
4k views

rsync -c -i flags identical files as different

My goal: given a list of files on local server, show any differences to the files with the same absolute path on remote server; e.g. compare local /etc/init.d/apache to same file on remote server. "...
user avatar
2 votes
1 answer
2k views

How can I check if a directory contains the same files of a TAR archive?

Let's say I have a folder Documents and a TAR file Documents.tar, how to check if the tar file contains the same files that are present in the directory? The more obvious solution to me would be to ...
marcanuy's user avatar
  • 268
2 votes
2 answers
658 views

Diff always fail to apply patch of files I make?

I have some files in my server that I wanted to make a patch for, so I took one of the files to test: cp /path/file ~/file So now I have just the same file in my root directory so I make any changes ...
Prix's user avatar
  • 5,021
2 votes
2 answers
2k views

Difficulty restoring a differential backup in SQL Server, 2 media families are expected or no files are ready for rollforward

I have sql backups copied from server A to server B on a nightly basis. We want to move the sql server from server A to server B without much downtime, but the files are very large. I assumed that ...
digiguru's user avatar
  • 235
2 votes
2 answers
5k views

Powershell find orphaned processes

I am looking for a way to find processes that do not have a parent process running (orphaned processes). Im attempting to do this using win32_process. I have the query that returns the attributes ...
user367081's user avatar
2 votes
2 answers
1k views

Load, Compare & Diff Registry of Windows Servers & Clients on VHDs?

We are deploying various Windows Servers {2008, 2012} & Clients {7,8.x, 10} and various custom applications, versions & special utilities. Without bothering the audience here on specifics of ...
Alex S's user avatar
  • 241
2 votes
3 answers
187 views

"One-sided" diff

I've got two large directory trees--think years of client work for an agency. One is old and out of date; the other is larger and in current use. I'd like to delete the former, but I want to be sure ...
justinbach's user avatar
2 votes
1 answer
3k views

Can you update a Hyper-V parent differencing disk to push updates to all children?

I have a Windows 2008 Datacenter server where I plan on creating dozens of VMs all using the same base Windows 2003 OS with some preinstall components and updates. I was wondering, 1) What are the ...
Chris Thompson's user avatar
1 vote
4 answers
3k views

linux diff command options

diff cookies.old cookies.new 5c5 < One cup vanilla extract --- > One teaspoon vanilla extract 7d6 < Six ounces chopped liver 21a22 Any flags/options can help me get rid of this 5c5, 7d6, ...
nitins's user avatar
  • 2,589
1 vote
2 answers
507 views

looking for a tricky one liner to get diff of awk output

Lets say i have two files like below: file1 a 23 b 34 c 47 file2 a justin_beiber_sucks b segmentation fault c jackson d nop Now what i want is to get a diff of the first column of two file. I'm ...
Aftnix's user avatar
  • 233
1 vote
2 answers
1k views

Interactive two panels diff for *nix console?

Could you please advise me about interactive two panels diff tool, something like http://www.sourcegear.com/diffmerge/, but for *nix console/ncurses or maybe somebody knows how DiffMerge can be run ...
deniszh's user avatar
  • 142
1 vote
2 answers
2k views

finding a group of string common in two files

I have used diff command in past.I faced a situation to which I did not had a clue here are some text strings (which can be stored in a file) CONFIG_XEN=y CONFIG_XEN_PVHVM=y ...
Registered User's user avatar
1 vote
2 answers
1k views

diff folders and copy results over

We use a third party newsletter system which updates frequently, usually around 100 files. Each time all the developers release is the whole application again with a changelog but there's usually too ...
robjmills's user avatar
  • 990
1 vote
4 answers
340 views

Diff for a locally modified package in Ubuntu

If I modify the source code of some package that I've installed with apt-get in Ubuntu, is there some package tool that will let me see the diff between what was the original installation and my ...
Everett Toews's user avatar
1 vote
2 answers
460 views

VirtualBox Differencing Disk Sizes

I've recently started trying to use VirtualBox for my new machine so I can prevent the base OS from any artifacts/etc. I've created a Base OS and removed the drive, marked it as immutable, and ...
crucible's user avatar
  • 113