diff - Command-line tool to display the differences between two files, or each corresponding file in two directories.
22
votes
7answers
28k views
Which GUI diff viewer would you recommend, with Copy-to-Left/Right functionality?
I've hardly ever used anything other than Meld. Can you recommend anything else?
It would be extra nice if you give a reason for your recommendation (as a Comment).
[note] I want an alternative ...
9
votes
4answers
6k views
How do you compare two folders and copy the difference to a third folder?
You've got three folders:
folder current, which contains your current files
folder old, which contains an older version of the same files
folder difference, which is just an empty folder
How do ...
9
votes
3answers
5k views
How do I “merge” two text files?
I recently upgraded from Ubuntu 12.04 to 12.10 and at one point, it encountered an Apache config file conflict in apache2.conf. I didn't give me a merge option at that point, so I just rejected the ...
4
votes
2answers
572 views
What does -u of diff really do?
Looks like -u can take an extra number argument, but I don't quiet get the manual,
It says,
-u, -U NUM, --unified[=NUM]
output NUM (default 3) lines of unified context
Someone name an ...
1
vote
2answers
3k views
How to make diff print a full file diff when a file does not exist?
I'm trying to compare files on the root file system with a backup, and I'd like the comparison to work a bit like git or svn diff when a file has been added or removed - That is, display the full file ...
23
votes
3answers
29k views
Comparing two files in Vim
Is it possible to view two files side-by-side in Vim? If so, how can I set up my editor to do this, and is there a way to diff between the two files within Vim?
I am aware of the :next and :prev ...
19
votes
7answers
8k views
Converting colored output into html
There are tools providing coloured output:
dwdiff -c File1 File2 # word level diff
grep --color=always # we all know this guy
...
The question is: How to convert their colored output of arbitrary ...
16
votes
2answers
8k views
Is there a condensed side-by-side diff format?
I have two log files with thousands of lines. After pre-processing, only some lines differ. These remaining lines are either real differences, or shuffled groups of lines.
Unified diffs allow me to ...
7
votes
2answers
11k views
Diffing two big text files
I have two big files (6GB each). They are unsorted, with linefeeds (\n) as separators. How can I diff them? It should take under 24h.
11
votes
4answers
502 views
rolling diffs for storage of highly similar files?
At work we do a nightly dump of our mysql databases. From day to day, I would guestimate that close to 90-95% of the data is duplicate, increasing as time goes on. ( Heck at this point some are ...
26
votes
4answers
2k views
Result of diff two files with switched lines says missing the same line twice
I am trying to understand the linux diff command on two files whose lines are just permutation of each other but not able to grok the output that it generates. Consider the three commands below:
...
8
votes
3answers
6k views
Diff, show modified line from right file only
I have file a and b and I would like to output lines of b that changed since it was cloned from a. Just the modified lines, no surrounding context, no diff offset marks.
How can I do that using shell ...
7
votes
1answer
2k views
Is there bdiff (1) in Linux?
There is bdiff(1) command in Solaris, which allow you to diff(1) files with size bigger than your RAM size (http://docs.oracle.com/cd/E19683-01/806-7612/files-23/index.html).
Is there something like ...
7
votes
2answers
4k views
How do I save changed files?
I have two folders:
ORIGINAL/
ORIGINAL_AND_MY_CHANGES/
My friend has a copy of ORIGINAL/. I would like to generate MY_CHANGES.tgz -- it should contain only new/changed files from ...
6
votes
3answers
2k views
Get diff changes between original files installed with apt and current files
I installed php5-fpm package using apt; then I made some changes to the PHP configuration files.
Now I would get the diffs between the original files versions (the ones of the package installed) and ...
6
votes
2answers
1k views
Same file, different filename due to encoding problem?
I was about to diff a backup from it's source to manually verify that the data is correct. Some chars, like åäö, is not shown correctly on the original data but as the clients (over samba) interpret ...
2
votes
2answers
113 views
how to count number of differences in large streams quickly?
I want to count the number of differences (different bytes) in two large streams (devices/files). E.g. two hard disks, or one hard disk and /dev/zero.
The program(s) involved must be fast, as fast ...
2
votes
1answer
2k views
Diff the output of two `awk` commands
I'm trying to compute the difference between the output of two awk commands but my simple attempts at it seem to be failing. Here is what I'm trying:
diff $(awk '{print $3}' f1.txt | sort -u) $(awk ...
6
votes
4answers
5k views
Understaning of diff output
I have file1.txt
this is the original text
line2
line3
line4
happy hacking !
and file2.txt
this is the original text
line2
line4
happy hacking !
GNU is not UNIX
if I do: ...
2
votes
3answers
4k views
Comparing text files using Bash and AWK
I have two text files, and I want to compare their corresponding values according to their rows and columns. By comparing, I mean to check if the values are equal and echo if the values are the same ...
2
votes
1answer
595 views
Reading two files into an IFS while loop — Is there a way to get a zero diff result in this case?
I have a text file full of several hundred lines of sequences like this:
b 29.
b 52.
c 84.
c 83.
c 94.
c 93.
c 61.
b 38.
c 81.
c 92.
c 28.
c 37.
...
1
vote
2answers
1k views
Diff command. Basic explanation
Just started with diff command. Can you please explain me,
diff thin_provisionings_controller.rb thin_provisionings_controller.rb[211]
512,513d511
include ThinProvisioningsGraphModule
So ...