diff - Command-line tool to display the differences between two files, or each corresponding file in two directories.

learn more… | top users | synonyms

2
votes
0answers
163 views

Using Unison with colordiff

I want Unison to show the diffs with colordiff. I’ve got diff = colordiff -u CURRENT2 CURRENT1 | less -R in my config file but it seems like Unison pipes the output to plain less nonetheless, so I ...
1
vote
2answers
88 views

Possible to view two text files side by side (read only)?

In emacs, we can view two text files side by side. Is it also possible to do so in some simpler/lighter applications such as less? Only viewing, no editing.
1
vote
1answer
659 views

Pipe diff file into patch?

Is there a way to pipe the diff output into patch? The -i parameter is for specifying a diff file, but I just want to do it more dynamically, since I will be updating regularly against a directory ...
1
vote
3answers
665 views

compare files line by line and create new one bash programming

I have two text files. File 2 has logs over 1,000,000. File 1 has IP addresses line by line. I want to read file 2 lines and search these lines in file 1, I mean: file 1: 34.123.21.32 45.231.43.21 ...
1
vote
2answers
183 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
113 views

How can I load the right hand pane of vim with a new file in linux?

I want to compare two files(say A and B) side by side(vertically) in in Vim. I open one of those two files(say A) and as per this answer in this site issue a Ctrl+w v . Now both the panels are showing ...
1
vote
2answers
2k 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 ...
1
vote
1answer
762 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 ...
1
vote
2answers
934 views

Comparing two directories in different servers

We copy our production code and data files to a testing server on a weekly basis. It can take hours, and sometimes it hasn't finished. What is the best method to confirm that the directories have ...
1
vote
1answer
32 views

Assign diff -y column names

I have two files and a shell script. File 1: Batman Superman John Snow Jack Sparrow Rob Stark File 2: Batman Ironman Superman Spiderman John Snow Arya Stark Jack Sparrow Rob Stark The hound ...
1
vote
2answers
1k views

diff binary files of different sizes?

Is there a neat way to see the difference between two binary files? They are mostly the same, but some bytes are changed, and one of the files has sequences inserted in some places. Diffing the ...
1
vote
1answer
783 views

What is the difference between Context output format and Unicode output format while taking diff?

What is the difference between Context output format and Unicode output format when taking a diff? diff -NBur dir1/ dir2/ diff -NBcr dir1/ dir2/
1
vote
2answers
94 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 ...
1
vote
1answer
143 views

Create a recursive diff directory. Copy reference and diff. Recreate original directory

I have several directories/web site resources, each has total size of several gigabytes. They are more than 90% the same. Sometimes only a few files are modified. I need to download these files for ...
1
vote
1answer
71 views

Interactive backup tool

I am looking for a backup (or diff) tool where I can select interactively which file I want to copy towards my external hard-disk. Let me explain with further details: I have two computers and an ...
1
vote
1answer
456 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
1answer
811 views

Diff similar lines

I'd like to print a list of lines where the first word in two files is identical, and the rest of the words are not. Some complicated mess with comm, grep and cut would be possible, but hopefully ...
1
vote
1answer
23 views

diff --horizon-lines=lines explained

I found both these quotes on the same diffoption --horizon-lines=lines: Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix. [source] The ...
1
vote
1answer
75 views

Running 'diff 'command after the 'find' command

I'm running this code on shell mv -f ~/sites/text1.txt ~/sites/text2.txt;find ~/sites/ -type f -exec sha1sum {} >> ~/sites/text.txt \;diff ~/sites/text1.txt ~/sites/text2.txt; However every ...
1
vote
1answer
212 views

RANCID like configuration differ for linux applications

I'm looking for a RANCID-like (http://www.shrubbery.net/rancid/) config management tool - the catch is that I want to manage config files for Linux applications like mysql, apache, memcache, varnish, ...
1
vote
1answer
67 views

Program to upgrade configuration files

When upgrading Ubuntu (and probably other *nixes), the upgrade process will show a diff of changed configuration files and ask whether I'd like to replace them, keep the old version, or manually merge ...
1
vote
1answer
381 views

RPMs and patching

I have 3 files (from here)that I have been given to install in an attempt to upgrade the compiler: binutils-2.13.2.1-1.mipsel.rpm binutils-2.13.2.1-1.src.rpm binutils-2.13.2.1-r5900-7.diff.gz ...
1
vote
0answers
61 views

How do I fix a patch [closed]

I am trying to fix a patch, and reviewed a couple of very interesting urls. One of which is this one: Handling Patch Rejects I like to make sure I am understanding the patch and the problem correctly. ...
1
vote
0answers
50 views

Merge several files with maximum 1 line difference

Suppose I have the following files: file0.c: int b=NULL; int a=NULL; file1.c: int b; int a=NULL; file2.c: int b; int a=NULL; I am looking to merge the files file1 and file2 to generate the ...
1
vote
2answers
96 views

Reduce redundant logfile

I often have longer redundant log files, redundant in the sense that blocks of text repeat with minor changes. The length of the files makes it difficult to spot the actual information. I had the idea ...
0
votes
3answers
53 views

how to compare total file

Suppose i have 2 config files such as: file 1: smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_authenticated_header = yes virtual_gid_maps = static:5000 File 2: ...
0
votes
1answer
542 views

Directory diff in bash script

I have a bash script that expands two archives (jar files) into two directories and then does a diff of the two folders. I want the diff to be piped into a file so I do this in the bash file. diff -r ...
0
votes
2answers
41 views

check two partitions by selecting random files and running sha1 hashes on two files of each partition

A previous answer to a post mentions to run sha1 hashes on an images of a dd drive clone image. Another answer to that post suggests mounting the dd image an then compare if the sha1 hashes of ...
0
votes
1answer
29 views

Read files in Directory and take diff

I have two directories named comp1 and comp2 and both have files named file1 and file2. I need a bash script which read file1 from both the directories and take diff of each file and redirect to some ...
0
votes
2answers
52 views

SSH using diff and still not working

I have 2 file, a.txt and b.txt and I want to compare them. a.txt contains: abc jkl < jkl mno > mno pqr <> pqr b.txt contains: abc jkl < jkl mno > mno pqr <> pqrs stu I'm ...
0
votes
1answer
47 views

Is this a good way to create a patch?

I would like to create a patch from a specific gcc branch comparing it to the official releases; so when I unpack the tarball from the stable release, I can apply the patch and get the equivalent of ...
0
votes
1answer
22 views

diff files within dirs listing by date modified

I was using MELD but it can't seem to sort by modification time, so I've been looking for a way to achieve something similar in terminal. I found a line of code find /path/to/dir1 /path/to/dir2 ...
0
votes
1answer
103 views

Is there an application to find similar documents?

Is there any good software that finds groups of multiple files that are similar, or where one file includes a part of another? I have a directory with lots of files mixed up. Among the files, are ...
0
votes
0answers
17 views

what does 1d0 mean in diff output? [duplicate]

Say you have two files file1 a b c d file 2 b c d e The first line of diff file1 file2 would be 1d0 I've read up on this and found that it means delete the lines in the first file at ...
0
votes
1answer
44 views

rcs and graphical diff

I have a machine running Ubuntu 6.06. Source files under rcs (no git available). I need to visually compoare older revs of files with the checked out version. Until now I have moved the file and ...
0
votes
0answers
62 views

How to compare two rfs directories with `diff`?

I've two RFS (RFS = Root File System) directories, which I would like to compare to each other with diff. Both directories represent an RFS of some other system, and they may contain links. If those ...
-1
votes
1answer
4k views

Bash function to compare two binary files [closed]

I need a function to compare 2 binary files, here the requirements: 2 files, not 3 or 4 files can't be assumed to exist avoid running checksum (CRC/MD5/SHA/...) until one must if running multiple ...