|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
Recommended Links | LCS problem | Program Understanding | Perl-based tools | ||||
Windiff | Norton Commander diff | Total commander diff | Examdiff | Beyond Compare | CSDiff | CompareIt | |
Diff | wdiff | dwdiff | kdiff3 | tkdiff | Patch |
|
|
Less | Admin Horror Stories | Unix History | Humor | Etc |
|
diff is one of the oldest UNIX commands (was included in UNIX around 1976). It compares the contents of the two files source file and target file (modified version) and produces "delta" -- lines that are changed or absent in either of files.
|
It was written by Hunt and McIlroy and based on the algorithm for file comparison that they created (see J. W. Hunt and M. D. McIlroy, An algorithm for differential file comparison, Bell Telephone Laboratories CSTR #41 (1976), PostScript (text edited from OCR, figures redrawn)). While it is the first it is still one of the best.
Both files in a classic UNIX diff are assumed to be text files. As file difference is an illusive concept that simplest approach is consider line indivisible and compute so called "longest common subsequence of lines"(lcs). Then anything not in this lcs is declared to belong to the difference set -- the minimal set of lines that needs to be changed for the transformation of source to the target.
But both string diff and diff based on words are definitely possible. String diff is essentially the problem that is studied in all algorithms for text file comparison as any text file can be trivially converted to the string is some alphabet with each line represented by one letter of this alphabet. Difference by word is also a trivial modification of the basic program. Essentially you first need to covert the text into "one word per line" format and then use line-based diff. Several such modifications exists (wdiff, dwdiff, see below) or can be easily written in any scripting language.
diff proved to be useful in so many cases that it is difficult to enumerate them. First and foremost this tool is used to discover differences between versions of a text file. In this role it is useful in keeping track of the evolution of a document or of a program. For example, often, a programmer needs to debug a software program with the codebase that contains several thousand (or even hundred thousand) lines. if the problem is present only is this version and is not present in older versions then you can diff the sources and use code browsers for the difference set to try to pinpoint the source of the problem. This approach can help dramatically narrow the slice of the program that probably contains the problematic code.
It is also used as a file compression method, since many versions of a (long) file can be represented by storing one (long) version of it and many (short) scripts of transforming the older version into newer versions of the same file. Another application is so called approximate string matching used, for instance, for the detection of misspelled words.
If we use diff for program understanding (which is comparing two versions of the program is usually about), then along with diff tools, powerful tools for source code browsing and, especially, slicers, are also necessary. Some are built into the IDE and some are standalone. The grand daddy of all slicers is Xedit that has built-in slicing capabilities since 1970th (famous "all" command). Among code browsers the cscope for C/C++ created by AT&T is probably one of the first useful implementations that address the problem.
diff also lead to creation of news class programs that use generation of the difference set as a part of their operation. The most popular among those is patch written by Larry Wall. Older version control systems were little more then diff and several shell scripts.
There several articles on the WEb that discuss this type of utilities. See for example
Dr. Nikolai Bezroukov
|
Switchboard | ||||
Latest | |||||
Past week | |||||
Past month |
Feb 16, 2021 | www.networkworld.com
colordiff
The colordiff command enhances the differences between two text files by using colors to highlight the differences.
SponsoredPost Sponsored by ReliaQuest
5 Often-Overlooked Log Sources
Some data sources present unique logging challenges, leaving organizations vulnerable to attack. Here's how to navigate each one to reduce risk and increase visibility.
$ colordiff attendance-2020 attendance-2021 10,12c10 < Monroe Landry < Jonathan Moody < Donnell Moore --- < Sandra Henry-StockerIf you add a -u option, those lines that are included in both files will appear in your normal font color.
wdiffThe wdiff command uses a different strategy. It highlights the lines that are only in the first or second files using special characters. Those surrounded by square brackets are only in the first file. Those surrounded by braces are only in the second file.
$ wdiff attendance-2020 attendance-2021 Alfreda Branch Hans Burris Felix Burt Ray Campos Juliet Chan Denver Cunningham Tristan Day Kent Farmer Terrie Harrington [-Monroe Landry <== lines in file 1 start Jonathon Moody Donnell Moore-] <== lines only in file 1 stop {+Sandra Henry-Stocker+} <== line only in file 2 Leanne Park Alfredo Potter Felipe RushvimdiffThe vimdiff command takes an entirely different approach. It uses the vim editor to open the files in a side-by-side fashion. It then highlights the lines that are different using background colors and allows you to edit the two files and save each of them separately.
Unlike the commands described above, it runs on the desktop, not in a terminal window.
SponsoredPost Sponsored by Outsystems
Strategies for Pixel-Perfect Applications across Web, Mobile, and Chat
This webinar will discuss key trends and strategies, identified by Forrester Research, for digital CX and customer self-service in 2021 and beyond. Register now
On Debian systems, you can install vimdiff with this command:
$ sudo apt install vimvimdiff.jpg <=====================
kompareThe kompare command, like vimdifff , runs on your desktop. It displays differences between files to be viewed and merged and is often used by programmers to see and manage differences in their code. It can compare files or folders. It's also quite customizable.
Learn more at kde.org .
kdiff3The kdiff3 tool allows you to compare up to three files and not only see the differences highlighted, but merge the files as you see fit. This tool is often used to manage changes and updates in program code.
Like vimdiff and kompare , kdiff3 runs on the desktop.
You can find more information on kdiff3 at sourceforge .
Sep 12, 2019 | www.tecmint.com
3. Kompare
Kompare is a diff GUI wrapper that allows users to view differences between files and also merge them.
Some of its features include:
<img aria-describedby="caption-attachment-21311" src="https://www.tecmint.com/wp-content/uploads/2016/07/Kompare-Two-Files-in-Linux.png" alt="Kompare Tool - Compare Two Files in Linux" width="1097" height="701" srcset="https://www.tecmint.com/wp-content/uploads/2016/07/Kompare-Two-Files-in-Linux.png 1097w, https://www.tecmint.com/wp-content/uploads/2016/07/Kompare-Two-Files-in-Linux-768x491.png 768w" sizes="(max-width: 1097px) 100vw, 1097px" />
- Supports multiple diff formats
- Supports comparison of directories
- Supports reading diff files
- Customizable interface
- Creating and applying patches to source files
Kompare Tool – Compare Two Files in Linux
Visit Homepage : https://www.kde.org/applications/development/kompare/
4. DiffMergeDiffMerge is a cross-platform GUI application for comparing and merging files. It has two functionality engines, the Diff engine which shows the difference between two files, which supports intra-line highlighting and editing and a Merge engine which outputs the changed lines between three files.
It has got the following features:
<img aria-describedby="caption-attachment-21312" src="https://www.tecmint.com/wp-content/uploads/2016/07/DiffMerge-Compare-Files-in-Linux.png" alt="DiffMerge - Compare Files in Linux" width="1078" height="700" srcset="https://www.tecmint.com/wp-content/uploads/2016/07/DiffMerge-Compare-Files-in-Linux.png 1078w, https://www.tecmint.com/wp-content/uploads/2016/07/DiffMerge-Compare-Files-in-Linux-768x499.png 768w" sizes="(max-width: 1078px) 100vw, 1078px" />
- Supports directory comparison
- File browser integration
- Highly configurable
DiffMerge – Compare Files in Linux
Visit Homepage : https://sourcegear.com/diffmerge/
5. Meld – Diff ToolMeld is a lightweight GUI diff and merge tool. It enables users to compare files, directories plus version controlled programs. Built specifically for developers, it comes with the following features:
<img aria-describedby="caption-attachment-21313" src="https://www.tecmint.com/wp-content/uploads/2016/07/Meld-Diff-Tool-to-Compare-Files-in-Linux.png" alt="Meld - A Diff Tool to Compare File in Linux" width="1028" height="708" srcset="https://www.tecmint.com/wp-content/uploads/2016/07/Meld-Diff-Tool-to-Compare-Files-in-Linux.png 1028w, https://www.tecmint.com/wp-content/uploads/2016/07/Meld-Diff-Tool-to-Compare-Files-in-Linux-768x529.png 768w" sizes="(max-width: 1028px) 100vw, 1028px" />
- Two-way and three-way comparison of files and directories
- Update of file comparison as a users types more words
- Makes merges easier using auto-merge mode and actions on changed blocks
- Easy comparisons using visualizations
- Supports Git, Mercurial, Subversion, Bazaar plus many more
Meld – A Diff Tool to Compare File in Linux
Visit Homepage : http://meldmerge.org/
6. Diffuse – GUI Diff ToolDiffuse is another popular, free, small and simple GUI diff and merge tool that you can use on Linux. Written in Python, It offers two major functionalities, that is: file comparison and version control, allowing file editing, merging of files and also output the difference between files.
You can view a comparison summary, select lines of text in files using a mouse pointer, match lines in adjacent files and edit different file. Other features include:
<img aria-describedby="caption-attachment-21314" src="https://www.tecmint.com/wp-content/uploads/2016/07/DiffUse-Compare-Text-Files-in-Linux.png" alt="DiffUse - A Tool to Compare Text Files in Linux" width="1030" height="795" srcset="https://www.tecmint.com/wp-content/uploads/2016/07/DiffUse-Compare-Text-Files-in-Linux.png 1030w, https://www.tecmint.com/wp-content/uploads/2016/07/DiffUse-Compare-Text-Files-in-Linux-768x593.png 768w" sizes="(max-width: 1030px) 100vw, 1030px" />
- Syntax highlighting
- Keyboard shortcuts for easy navigation
- Supports unlimited undo
- Unicode support
- Supports Git, CVS, Darcs, Mercurial, RCS, Subversion, SVK and Monotone
DiffUse – A Tool to Compare Text Files in Linux
Visit Homepage : http://diffuse.sourceforge.net/
7. XXdiff – Diff and Merge ToolXXdiff is a free, powerful file and directory comparator and merge tool that runs on Unix like operating systems such as Linux, Solaris, HP/UX, IRIX, DEC Tru64. One limitation of XXdiff is its lack of support for unicode files and inline editing of diff files.
It has the following list of features:
<img aria-describedby="caption-attachment-21315" src="https://www.tecmint.com/wp-content/uploads/2016/07/xxdiff-Tool.png" alt="xxdiff Tool" width="718" height="401" />
- Shallow and recursive comparison of two, three file or two directories
- Horizontal difference highlighting
- Interactive merging of files and saving of resulting output
- Supports merge reviews/policing
- Supports external diff tools such as GNU diff, SIG diff, Cleareddiff and many more
- Extensible using scripts
- Fully customizable using resource file plus many other minor features
xxdiff Tool
Visit Homepage : http://furius.ca/xxdiff/
8. KDiff3 – – Diff and Merge ToolKDiff3 is yet another cool, cross-platform diff and merge tool made from KDevelop . It works on all Unix-like platforms including Linux and Mac OS X, Windows.
It can compare or merge two to three files or directories and has the following notable features:
<img aria-describedby="caption-attachment-21418" src="https://www.tecmint.com/wp-content/uploads/2016/07/KDiff3-Tool-for-Linux.png" alt="KDiff3 Tool for Linux" width="950" height="694" srcset="https://www.tecmint.com/wp-content/uploads/2016/07/KDiff3-Tool-for-Linux.png 950w, https://www.tecmint.com/wp-content/uploads/2016/07/KDiff3-Tool-for-Linux-768x561.png 768w" sizes="(max-width: 950px) 100vw, 950px" />
- Indicates differences line by line and character by character
- Supports auto-merge
- In-built editor to deal with merge-conflicts
- Supports Unicode, UTF-8 and many other codecs
- Allows printing of differences
- Windows explorer integration support
- Also supports auto-detection via byte-order-mark "BOM"
- Supports manual alignment of lines
- Intuitive GUI and many more
KDiff3 Tool for Linux
Visit Homepage : http://kdiff3.sourceforge.net/
9. TkDiffTkDiff is also a cross-platform, easy-to-use GUI wrapper for the Unix diff tool. It provides a side-by-side view of the differences between two input files. It can run on Linux, Windows and Mac OS X.
Additionally, it has some other exciting features including diff bookmarks, a graphical map of differences for easy and quick navigation plus many more.
Visit Homepage : https://sourceforge.net/projects/tkdiff/
Having read this review of some of the best file and directory comparator and merge tools, you probably want to try out some of them. These may not be the only diff tools available you can find on Linux, but they are known to offer some the best features, you may also want to let us know of any other diff tools out there that you have tested and think deserve to be mentioned among the best.
Feb 04, 2017 | www.cyberciti.biz
The diff command compare files line by line. It can also compare two directories:
# Compare two folders using diff ## diff /etc /tmp/etc_oldRafal Matczak September 29, 2015, 7:36 am§ Quickly find differences between two directories
And quicker:diff -y <(ls -l ${DIR1}) <(ls -l ${DIR2})
Diffstat reads the output of the diff command and displays a histogram of the insertions, deletions, and modifications in each file. Diffstat is commonly used to provide a summary of the changes in large,... complex patch files
["] rsync user
by Richard Harris - Aug 28th 2005 15:08:19I am the author of Walker, a Python script for uploading sites via ftp and scp. Walker is very good for maintaining sites of moderate size, for use over slow connections, for users with limited resources, and for users who need customized control over the upload.
For some time I maintained two and three sites using Walker. Now I am maintaining over ten sites and their related project files. I use rsync exclusively, called from python and ruby scripts which handle mirrored and standardized directory structures across the sites, in other word the sites and dev dirs are all to the same pattern. In this way, I am able to easily maintain HTML, data, and cgi-bin files and to back-up and restore the web sites and the project development files.
dirdiff is a graphical tool to display the differences(a la diff) between files in directories. Given two or more directory trees, dirdiff will display the differences between them in various glorious colors. It provides merging and the creation of patches.
With diff-ext, GNOME users can compare and merge files from within Nautilus. If, instead, you use KDE 3, try out kdiff-ext from the same site, which works with Konqueror. Each utility handles paths to files and directories and invokes an external diff tool to perform the grunt work. With diff-ext you can easily compare two files with different names, from different directories, or whole directory trees.pAmong the major Linux distributions, the only package I could find was gdiff-ext for Ubuntu Intrepid. I'll build the program from source using version 0.3 of gdiff-ext on a 64-bit Fedora 9 machine. At the time of writing the downloads page erroneously listed 0.2.4 as the latest version of gdiff-ext. You might like to click on the "Older versions" link at the bottom of the project's SourceForge.net page to investigate what releases exist for download to verify the latest version.
To build gdiff-ext you'll need to have nautilus-devel installed on Fedora 9 or openSUSE 11.
About: stroy is a smart diff tool. It specializes in directories of files. Its differentiating feature is the ability to match files that have different names, locations, and content.
Changes: Placeholders for deleted files were added. This makes the synchronized scrolling much smoother. The old problem on Windows where files with spaces in their path wouldn't open is finally fixed. An update checker informs users about new releases. Most known bugs are fixed.
About: dwdiff is a front-end for the diff program that operates at the word level instead of the line level. It is different from wdiff in that it allows the user to specify what should be considered whitespace, and in that it takes an optional list of characters that should be considered delimiters. Delimiters are single characters that are treated as if they are words, even when there is no whitespace separating them from preceding words or delimiters.
dwdiff is mostly commandline compatible with wdiff.
The default output from dwdiff is the new text, with the deleted and inserted parts annotated with markers. Command line options are available to change both what is printed and the markers.
Changes: Unicode support was added as well as an option to treat all punctuation characters as delimiters.
About: Meld is a visual diff and merge tool. It integrates with most version control systems. The diff viewer lets you edit files in place (diffs update dynamically), and a middle column shows detailed changes and allows merges. The margins show location of changes for easy browsing, and it also features a tabbed interface that allows you to open many diffs at once.
Changes: Tab rendering was improved. Folder comparison was made much faster for large directories. A fatal i18n bug was fixed. UI tweaks and cleanups were made. A vc library redundancy was cleaned up. Various version control fixes were made.
About: Diffuse is a graphical tool for comparing and merging text files. Diffuse is able to compare an arbitrary number of files side-by-side and gives the user the ability to manually correct line-matching and to edit the files directly. Diffuse supports UTF-8 encoded Unicode.
Changes: Diffuse now provides a choice of codecs for reading and writing files. The editor has been updated to support cut-n-paste using the primary selection. The search feature now has more options.
About: BeeDiff is a graphical file comparator. It compares two text files and highlights differences in colors. The program is simple, useful, and efficient.
Changes: Drag and drop has been implemented. There are a few corrections and optimisations.
About: BeeDiff is a graphical file comparator. It compares two text files and highlights differences in colors.
Changes: Users can give paths of files to compare as parameters. Comparison statistics are displayed in a status bar. The application saves its size and position on exit. A history of compared files (combo boxes over text windows) has been implemented, which is saved on exit. A bash install script has been created that rebuilds the program and installs it in a "beediff" subdirectory of the user's home directory.
freshmeat.netCtcompare allows you to compare several sets of C or Java code trees on a token basis, rather than on a line by line basis. These programs help to identify code copying and similarities between snippets of code in both trees, even if the actual lines are dissimilar.
Release focus: Major feature enhancements
Changes:
Speed has been significantly improved, especially when there are large amounts of similarities between code trees. This release has a command line option to sort the results by the number of tokens in a run. Initial support for Java source files has been added.Author:
Warren Toomey [contact developer]
Freedup finds and eliminates duplicate files by linking them, and thus reduces the amount of used disk space within one or more file systems. By default, hardlinks are used on a single device, symbolic links when the devices differ. A set of options allows you to modify the methods of file comparison, the hash functions, the linking behavior, and the reporting style. You may use batch or interactive mode. Freedup usually only considers identical files, but when comparing audio or graphics files, you may elect to ignore the tags.
Release focus: Major bugfixes
Changes:
The major bugfix concerns the (n+m) assertion. Checks were implemented so that no endless loops with the extra style mp4 should occur. A minor one is to read and write the environment variable "globalkey" (-k) as letter not as ascii code. Please note that you have to correct existing environments manually. The new feature that lists the existing environments should help you on that.
freshmeat.netdwdiff is a front-end for the diff program that operates at the word level instead of the line level. It is different from wdiff in that it allows the user to specify what should be considered whitespace, and in that it takes an optional list of characters that should be considered delimiters. Delimiters are single characters that are treated as if they are words, even when there is no whitespace separating them from preceding words or delimiters. dwdiff is mostly commandline compatible with wdiff. The default output from dwdiff is the new text, with the deleted and inserted parts annotated with markers. Command line options are available to change both what is printed and the markers.
Release focus: Major feature enhancements
Changes:
A new option was added for showing the line numbers from the old and the new file along with an option that shows several lines of context around changes but skips large common blocks of text.Author:
G.P. Halkes
http://os.ghalkes.nl/dwdiff.html
Meld is a visual diff and merge tool. It integrates with most version control systems. The diff viewer lets you edit files in place (diffs update dynamically), and a middle column shows detailed changes and allows merges. The margins show location of changes for easy browsing, and it also features a tabbed interface that allows you to open many diffs at once.
At Guiffy our focus is Advanced Cross-Platform Diff/Merge software. Our product is a diff tool, merge tool, and folder compare tool all-in-one that makes comparing, merging, and upgrading sources as easy and reliable as possible. Guiffy is used around the world by thousands of professionals in more than 30 countries on an endless variety of platforms (Including: Windows, Linux, MacOS, and Unix). And, our downloads are packaged as InstallAnywhere kits to make setup a snap. Plus, our Support will help get you going and keep you up-to-date on our latest and greatest advances...
- Guiffy's Trustworthy 3-way merge tool, called SureMerge, surpasses all other merge tools with its intelligent functionality and ease-of-use. See our SureMerge White Paper which includes test kit files for evaluating 3-way merge tools.
- As a diff tool, Guiffy can be used to compare source files of any type
September 1, 2006
Synchronize It! 3.2 is ready - with smart files comparison, archive bit support, file search panel and many other tweaks and fixes.
Get it!
ExamDiff is a freeware Windows 95/98/Me/NT/2000/XP/2003/Vista tool for visual file comparison. It has a number of simple and convenient features that many users have been asking for a long time from a file comparison tool.
ExamDiff is a part of a suite of products that includes FtpVC, an FTP based Version Control System that allows joint software development remotely over the Internet.
Key Features
- Automatically detects file changes.
- One push re-compare function.
- Drag and drop support.
- Easy editing of the first and second files, by spawning an external editor of choice.
- Saves the file differences in a standard UNIX DIFF file.
- Easy navigation through the differences.
- "Search" command.
- Fully customizable.
- Adjustable pane splitter with smooth synchronized scrolling.
- Extensive command line interface.
Xfiles is an interactive utility for comparing and merging one file tree with another over a network. It supports freeform work on several machines (no need to keep track of what files are changed on which machine). Xfiles can also be used as a cross-validating disk<->disk backup strategy (portions of a disk may go bad at any time, with no simple indication of which files were affected. Cross-validate against a second disk before backup to make sure you aren't backing up bad data).A client/server program (GUI on the client) traverses a file tree and reports any files that are missing on the server machine, missing on the client machine, or different. For each such file, the file size/sizes and modification date(s) are shown, and a comparison (using Unix diff) can be obtained. For files that are missing from one tree, `similarly named' files in that tree are reported. Inconsistent files can then be copied in either direction or deleted on either machine. The file trees do not need to be accessible via nfs. Files checksums are computed in parallel, so largely similar trees can be compared over a slow network link. The client and server processes can also be run on the same machine.
KDiff3 is a program that
- compares or merges two or three text input files or directories,
- shows the differences line by line and character by character (!),
- provides an automatic merge-facility and
- an integrated editor for comfortable solving of merge-conflicts,
- supports Unicode, UTF-8 and other codecs, autodetection via byte-order-mark "BOM"
- supports KIO on KDE (allows accessing ftp, sftp, fish, smb etc.),
- Printing of differences,
- Manual alignment of lines,
- Automatic merging of version control history ($Log$),
- and has an intuitive graphical user interface.
- Windows-Explorer integration Diff-Ext-for-KDiff3 - shell extension included in installer (originally by Sergey Zorin: see also Diff Ext)
- Read what else is special in a short abstract (PDF).
dwdiff is a front-end for the diff program that operates at the word level instead of the line level. It is different from wdiff in that it allows the user to specify what should be considered whitespace, and in that it takes an optional list of characters that should be considered delimiters. Delimiters are single characters that are treated as if they are words, even when there is no whitespace separating them from preceding words or delimiters. dwdiff is mostly commandline compatible with wdiff. Only the --autopager, --terminal and --avoid-wraps options are not supported.
The default output from dwdiff is the new text, with the deleted and inserted parts annotated with markers. Command line options are available to change both what is printed, and the markers.
Dec 09, 2005 (Stuart D. Gathman) GNU Diff algorithm in Java Bug fix and setOutput for DiffPrint. I have translated the GNU Diff algorithm to a Java class. The Diff class computes the differences between two Object arrays as a list of changes. ...
www.bmsi.com/java/
The dwdiff utility, written by G.P. Halkes and distributed under the Open Software License 2.0, is a front end for diff that displays a word-by-word comparison of files.The diff utility is great by itself, and fine for programmers, but not as useful for anyone who might want to see a word-by-word comparison, rather than line-by-line.
Let's take a look at two drafts of some regular text, and see how they differ. The first example shows two drafts of the same paragraph that I've run through GNU diff, without any options. The first draft is in a text file called draft1, and the second is in a text file called draft2, so the syntax for diff is
diff draft1 draft2
, which gives us:1,6c1,5 < To start with, you may need to install Tomboy, since it's not yet < part of the stable GNOME release. Most recent distros should have < Tomboy packages available, though they may not be installed by < default. On Ubuntu, run apt-get install tomboy, which should pull < down all the necessary dependencies -- including Mono, if you don't < have it installed already. --- > You may need to install Tomboy, since it's not yet part of the > stable GNOME release. Most recent distros should have Tomboy packages > available, though they may not be installed by default. On Ubuntu, > run apt-get install tomboy, which should pull down all the necessary > dependencies, including Mono, if you don't have it installed already.That's not very useful when it comes to trying to see what has changed. Because of the way that regular text is formatted, when you make a change in one line of text, the odds are that it will affect the next line, and the line after that, and so on. So, plain ol' diff just doesn't cut it.
Let's take a look at what happens when we use dwdiff instead. The syntax for dwdiff is the same; just run
dwdiff draft1 draft2
:[-To start with, you-]{+You+} may need to install Tomboy, since it's not yet part of the stable GNOME release. Most recent distros should have Tomboy packages available, though they may not be installed by default. On Ubuntu, run apt-get install tomboy, which should pull down all the necessary [-dependencies ---] {+dependencies,+} including Mono, if you don't have it installed already.Text that has been deleted is enclosed in brackets with a minus sign, and text that has been added has been enclosed in braces with a plus sign. Dwdiff's output is much easier to read when you're working with prose rather than code.
Another way to view the text is to use the
--less-mode
option, which will provide markup suitable for viewing in less. Instead of using brackets and braces to denote changes, text that has been added will be displayed in bold, and text that has been removed will be displayed with an underscore. This may vary, depending on your terminal emulator -- in my use of dwdiff, the bold text shows up just fine in an xterm and GNOME Terminal, but doesn't show up properly in Konsole.The dwdiff utility also supports a color mode, which displays redacted text in red and additional text in green. The syntax for color is
dwdiff -c draft1 draft2
.In the example, you can see that the word "you" is actually common to both files -- the only difference is that the phrase "To start with," has been removed and "you" has been capitalized because it's now at the beginning of the sentence.
While case-sensitivity is often important for programming, you may want to overlook case when looking at documentation or a short story. To do that, you can use dwdiff's
-i
option (longer version,--ignore-case
), which tells dwdiff to ignore case when comparing words.Just the facts
I like to see changes in context, but if you prefer to see changes by themselves, dwdiff has the
--no-common
option, which tells dwdiff to print only the words that have changed between files. The short version of the option is-3
. For example, runningdwdiff -3 draft1 draft2
provides a much more concise report:====================================================================== [-To start with, you-]{+You+} ====================================================================== [-dependencies ---] {+dependencies,+} ======================================================================If you'd like to shorten that even further, you can use the
--no-deleted
option, which tells dwdiff to omit words that were deleted from the first file. The short option for--no-deleted
is-1
. Usingdwdiff -1 -3 draft1 draft2
provides output like this:====================================================================== You ====================================================================== dependencies, ======================================================================
To omit words added to the second file, you can use the
--no-inserted
option. The short option for that is-2
.You may be less interested in specific changes than seeing just how much has changed between versions of a file. To see the word count and percentage changed between two files, use the
-s
option, which produces output similar to this:old: 1662 words 1597 96% common 10 0% deleted 55 3% changed new: 1666 words 1597 95% common 13 0% inserted 56 3% changedThis gives us the word count of the original file and the new file, how many words are in common, the number and percent deleted from the original and the percent and number inserted in the original.
The dwdiff utility uses diff, and you can pass some options to diff using dwdiff's
-D
option to change the way diff behaves -- so long as that doesn't change the output coming from diff. The syntax for this isdwdiff -D-option file1 file2
, so the diff option is included directly behind the-D
option for dwdiff.For instance, diff has an option (
-y
) to display changes side-by-side. This won't work with dwdiff, because it throws off the formatting that the program expects. You could, however, pass options like diff's-d
option, which tells diff to use a different algorithm to find fewer changes. This will affect diff's behavior, but not the format of its output.Note that dwdiff is not the only game in town. The GNU wdiff utility is another front end to diff that produces word diffs between files, and the options for wdiff are similar, but dwdiff has a few different features.
The dwdiff utility is the only word diff utility with color support, and it also provides support for specifying characters to be treated as whitespace or as delimiters. To specify a character to be used as whitespace, which is ignored, use the
-W
option.Delimiters are characters that are treated as words, even if they're not separated by whitespace. Specify delimiters using the
-d
option -- so if you want to specify a semicolon as a delimiter, you'd usedwdiff -d \; file1 file2
. In this case, you need to escape the semicolon using the backslash (\
) character so that it's not interpreted by the shell.If you spend any amount of time comparing text files, I'd suggest installing dwdiff and testing it out. It's a handy tool to have alongside the traditional diff utility, and makes spotting changes in text files easier.
"The diff and patch utilites can be intimidating to the newcomer, but they are not all that difficult to use, even for the non-programmer. If you are at all familiar with makefiles, you might find yourself frequently wanting to patch a file, either to correct an error that you've found or to add something that you need to the makefile.
"After I began using the mrxvt terminal, I wanted to give it Japanese capability. My main O/S is FreeBSD..."
Related Stories:
SearchOpenSource: Patch Work Management: Keeping the Pieces Together(Feb 28, 2006)
Editor's Note: Diagnosing the Linux Body(Feb 28, 2004)
Linux Journal: The Kernel Hacker's Guide to Source Code Control(Aug 21, 2002)
Current released version is 1.6n (February 24, 2006). You can download it from these links.Key Features
- Automatically detects file changes.
- One push re-compare function.
- Drag and drop support.
- Easy editing of the first and second files, by spawning an external editor of choice.
- Saves the file differences in a standard UNIX DIFF file.
- Easy navigation through the differences.
- "Search" command.
- Fully customizable.
- Adjustable pane splitter with smooth synchronized scrolling.
- Extensive command line interface.
The full feature list can be found here
Meld is a visual diff and merge tool. It integrates especially well with CVS. The diff viewer lets you edit files in place (diffs update dynamically), and a middle column shows detailed changes and allows merges. The margins show location of changes for easy browsing, and it also features a tabbed interface that allows you to open many diffs at once.
Ever tried to keep up, on an hourly basis, with two other developers? Each of you is working in your own branch. One is doing far-out research. One is doing the next stable release. One is doing the current stable release. Never seriously used X-windows or emacs? Where do you compromise your development-style principles? When you're faced with 300,000 lines of code, and daily merges [that took one developer only one hours' work] are cut from six hours to 30 minutes. Enter dirdiff.
So you use vi, linux-console-mode with six 80x60 screens, diff, patch, ctags and grep. Get a life and use emacs? No thanks. tried it. Was told that it didn't have different modes for text-editing and text-entry, it was better all-round. Had this wonderful thing called emerge, it could solve all my problems of how to do, as Jeremy Allison described it from over a year ago, "The MFH (tm)" - The Merge From Hell.
One Samba team member had already tried, and failed. To give you an idea of the size of the task, the diff file between the stable Samba 2.0 tree and what is now the Samba TNG tree (The Next Generation), was 7 megabytes, and that was six months ago.
Two and a half years ago, the NT Domains for Unix project started, with Paul Ashton's "Welcome to the SAMBA Domain" work. Since that time, when the Samba source was only 150,000 or so lines of code, both the stable Samba 2.0 production release tree and the TNG branch added an extra 50,000 lines of code - each. Fortunately, as it turns out, the majority of the work in each branch was done in totally different areas. The remaining areas are a nightmare to merge, and a pain in the wrists to keep up-to-date on a daily basis.
So, what tools were available? Well... emerge. Except that means, emacs. Eventually, I cornered someone, late on a Friday, for instructions on how to use emerge. and emacs. Starting with one file, it quickly became obvious that this simply wasn't going to cut it. Press a, b, b, ab OOPS urr, Paul, how do I get out of this, to which the response was, "'Bye, have a good weekend". to which my response was, "Ctrl-c, argh, ctrl-d, ARGH, ctrl-z killall emacs".
If people laugh at me for using an editor that causes me to press keystrokes such as mx:0d'x and yyP in notepad and pine, I will respond, "and what's emerge, then?"
The very same Paul (who is going to kill me for this article, he really doesn't want any more maintainer-request-email than he already gets) is a fan of tcl and wish. In a former existence, instead of abandoning a really large tcl script in favour of a better, faster language, he wrote a code-optimiser for tcl.
One of his tools that he has written in tcl is dirdiff. dirdiff, in a previous incarnation, was able to show you one window with a comparative diff of two or more directories, and you select one file from two of thoes directories and it shows you the differences. If you liked one file better than the other, you could select the "copy" menu to copy one file over the other. Great for getting rid of all those pesky little mods by another developer that you never really liked, anyway, their code always got in the way of yours.
Anyway.
dirdiff-previous-life showed up the different lines in pretty colours. To give you some idea, take a straight diff (diff file1.c file2.c). If there's a <, display that bit in red. If there's a >, display that bit in green. Insert red bits and green bits on-screen in amongst a bit of context before and after, and voila, that's a dirdiff file display. Then someone (I forget who) thought, you know, it would be really good if i could clickety-click on da red bit or da green bit, and it goes into one of the files...
*Fortunately*, Paul *also* needed something like this, as he needed to merge three sets of pppd branches, and so rather than spend time manually going back to diff and patch, he set about adding little windows all the way down the left-hand-side of dirdiff's file display, one for each line of the read bits and green bits. This means that if the diffs are large, wish gets *really* pushed to the limit: that's a lot of little windows. Tell you what, though: I don't care if it's slow, it saves me that much time. And Paul's speed-optimisations help a lot.
So, how do you use the new, improved, dirdiff? Well, at an xterm, you type:
dirdiff ~/samba-tng/source/smbd ~/samba-main/source/smbd &and up comes a windows with all the files that are common between the two directories. select a file, and you get a dirdiff file-window, with red bits and green bits, and on each red bit and green bit, there is a series of buttons at the left. If you want to make a "change", you select a button, with left-mouse. If you want to make a "group change", use right-mouse and an entire group of buttons will select or deselect. Having selected all your "changes" you wish to make, from the menu, you then select the file to which all the "changes" are to be applied. Behind the scenes, this creates a straight-diff patch file, which is then applied to the file you selected. The result: only the "changes" you selected are made to the file. Hit "Rediff", and wow, you have less differences between the two files than when you started.To give you some idea of the speed at which this can be done, I use dirdiff by positioning the mouse cursor (IBM thinkpad nibble-thing) over the left-hand-set-of-buttons, then rapidly press down-arrow on the keyboard (about 3 or 4 times a second), interspersed with either right-mouse or left-mouse clicks *without* changing the position of the mouse. In this way, a 3,000-line file with... 50 to 100 sets of diff-style modifications can be updated in about two minutes, especially if you've already gone over exactly the same files about once every two days, for the last three weeks, and you know pretty much instantly the bits that you want to keep and those that you recognise were added by someone else, very recently.
I wasn't kidding about taking six hours to merge one hours' work by another developer, using diff and patch. I wasn't sure exactly which files in which directories had been modified (about ten, out of about a hundred files), and so had to check the whole lot... again, having just spent 48 hours manually merging an extra 70,000 lines of smbd code into the Samba TNG branch. Now, using dirdiff, it's a pretty trivial task to keep up-to-date. I still have to do cvs diff -d -u -w -b -B > diff.output and check the output, before committing... just to make absolutely sure.
I hate X-windows. I think it's a complete waste of a good computers' time to run graphics. You can't edit two files and press alt-f1,f2,f1,f2 page-down f1 page-down, alt-f2,f1 page-down f1 page-down to compare two files, and even if you could, they would be displayed in some stupid variable-width font. [I use this console-screen-switch technique *as well as* diff, quite frequently: the human eye works by detecting changes, and they show up *really* well when you do this, *especially* when doing comparative hex-dumps of Windows NT Network traffic and corresponding Samba Network traffic to find out the exact, unknown, undocumented bit-patterns that *might* be the cause of a major lack of functionality in Samba - SMB is like that...].
So what caused me, who on receipt of a .doc or .xls file will resort to running strings on it in order to deduce its contents, or sends it to someone else for printing, even if it's confidential, to use graphical interfaces?
dirdiff.
SeeDiff is a graphical diff utility that shows the differences between directories and their
files, based on the SeeSoft representation.SeeDiff can display the output of diff recursively applied to directories and their subdirectories.
sdiff
TkDiff is a graphical front-end for the standard Unix diff utility. Not bad but its impossible to change files and set parameters like -dbB. See also tkCVS, a graphical front-end to CVS.
ediff, developed by Michael Kifer, is a visual interface to diff and patch, accessed within emacs, that highlights the differences between two files in color. It features:
- highlights differing region in multiple colors, including differences within the region;
- view the files being compared side-by-side (windows split vertically), one-over-the-other (windows split horizontally) or in separate windows (frames);
- either of the files being compared can be patched with the differences of the other, and old differences can also be recovered.
Ediff is part of the standard Emacs and Xemacs distribution.
Periodic updates are available at:
ftp://ftp.cs.sunysb.edu/pub/TechReports/kifer
- mgdiff, developed by Daniel Williams, is a graphical front-end to diff. When the user selects two files for comparison, it runs the diff command, parses the output and presents the results graphically. This presentation can also be used to generate a user-specified merge of the two files into a third file.
This program's appearance is based upon a program called gdiff, available for Silicon Graphics workstations.
The latest version of mgdiff is available for ftp at:
- tkdiff, developed by John Klassa, is a graphical front-end for the standard Unix diff utility, based on Tcl/Tk. Its features include:
The latest version, 1.0b9, is available at:
- Highlighted difference regions;
- side-by-side viewing of files;
- linked (synchronized) scrolling of the two files;
- random access to difference regions.
ftp://ftp.neosoft.com/languages/tcl/alcatel/code/tkdiff-1.0b9.tar.gz
- xdiff, developed by Paul Lucas, is another graphical diff tool based on the SGI gdiff utility.
It is available at:
- tkxcd, is a diff front end that has a look and feel similar to Atria ClearCase's xcleardiff.
Available at:
ftp://ftp.redhat.com/pub/contrib/RPMS/tkxcd-1.1.0-1.i386.rpm
ftp://ftp.redhat.com/pub/contrib/SRPMS/tkxcd-1.1.0-1.src.rpm
EXDIFF from Software Research Inc
Google matched content |
Keith Devens .com - Differencing programs
Diff - Wikipedia, the free encyclopedia
Comparison of file comparison tools - Wikipedia, the free encyclopedia
Tkdiff - TkDiff is a graphical front-end for the standard Unix ...
[Wikitech-l] wikipedia diff tool
John Resig - Javascript Diff Algorithm
Diffutils - GNU Project - Free Software Foundation (FSF)
How to Use the Windiff.exe Utility (Microsoft)
WinDiff - Wikipedia, the free encyclopedia
WinDiff (or WinMerge), the way you want it! - The Code Project - Shell Programming
Download windiff.zip. Contains windiff.exe, windiff.hlp, and gutils.dll. I'd recommend checking out other differencing programs.
dwdiff is a front-end for the diff program that operates at the word level instead of the line level. It is different from wdiff in that it allows the user to specify what should be considered whitespace, and in that it takes an optional list of characters that should be considered delimiters. Delimiters are single characters that are treated as if they are words, even when there is no whitespace separating them from preceding words or delimiters. dwdiff is mostly commandline compatible with wdiff. Only the --autopager, --terminal and --avoid-wraps options are not supported.
The default output from dwdiff is the new text, with the deleted and inserted parts annotated with markers. Command line options are available to change both what is printed, and the markers.
Guiffy SureMerge is the diff/merge built into Seapine's Surround SCM and Visible Systems' Razor SCM.
- Guiffy's smart & trustworthy 3-way diff/merge, called SureMerge, surpasses all other merge tools with its intelligent functionality and ease-of-use. See our SureMerge White Paper which includes test kit files for evaluating 3-way merge tools.
- Guiffy can be used to compare and diff/merge source files of any type with builtin support of UNICODE, MBCS, and over 150 File Encoding and character set formats.
- Guiffy implements a blend of 3 diff algorithms to provide the best visual compare results (including tuneable in-line diffs highlighting) and trusted smart merge capabilities.
- Guiffy also provides sophisticated folder and file tree compare and synchronization capabilities.
- Plus, a command line interface is included for automation and integration with CM systems (as a value-added diff/merge plugin) including: AccuRev, Allfusion Harvest, ClearCase, CMSynergy, Dimensions, MKS Integrity, Perforce, PVCS, StarTeam, and Visual Studio Team Foundation Server.
- CVS and SVN Pros use Guiffy SureMerge for all their industrial strength merging.
- And, Guiffy comes with a Java API package (Guiffy Inside), so you can use it as a component in your application.
Current released version is 1.6n (February 24, 2006). You can download it from these links.Key Features
- Automatically detects file changes.
- One push re-compare function.
- Drag and drop support.
- Easy editing of the first and second files, by spawning an external editor of choice.
- Saves the file differences in a standard UNIX DIFF file.
- Easy navigation through the differences.
- "Search" command.
- Fully customizable.
- Adjustable pane splitter with smooth synchronized scrolling.
- Extensive command line interface.
The full feature list can be found here
AlgorithmDiff - Compute `intelligent' differences between two files - lists - search.cpan.org
Span -- a module for computing the difference between two files ...
Diff - Compare two files and print differences
Araxis Project Management & File-Folder Comparison
Araxis creates software that enables you to take control of your work and be more productive. Araxis products are used worldwide by tens of thousands of professionals.
[More about Araxis]ExamDiff is a freeware Windows 95/98/Me/NT/2000/XP/2003/Vista tool for visual file comparison. It has a number of simple and convenient features that many users have been asking for a long time from a file comparison tool.
ExamDiff is a part of a suite of products that includes FtpVC, an FTP based Version Control System that allows joint software development remotely over the Internet.
Key Features
- Automatically detects file changes.
- One push re-compare function.
- Drag and drop support.
- Easy editing of the first and second files, by spawning an external editor of choice.
- Saves the file differences in a standard UNIX DIFF file.
- Easy navigation through the differences.
- "Search" command.
- Fully customizable.
- Adjustable pane splitter with smooth synchronized scrolling.
- Extensive command line interface.
Beyond Compare®, the advanced file and folder comparison utility for Windows, helps you visualize changes in your code, keeps your directories in sync, and validates copies of your data. More...
Start your free 30-day trial now to see what Beyond Compare can do for you.
Stop making guesses at what's changed between two files--discover the CSDiff difference!" - (Lockergnome's Windows 95 / NT E-Zine, issue #49) |
ComponentSoftware Diff (CSDiff) is a free, advanced file-difference analysis tool for Microsoft Windows.
CSDiff is a great asset to anyone in need of analyzing changes which have been made between two revisions of the same file or folder.
CSDiff is commonly used when analyzing program source files, HTML documents and MS-Word documents.
New Release: CSDiff v5.0
CSDiff v5.0 has been released. Click here to read more and download your copy now !!Read the highlights of CSDiff
See the CSDiff screenshots
Download CSDiff - for FREE !!
One of the main features of upcoming version 4 of our file comparison tool will be support for alternative integrated viewers\editors.
To implement this feature we had to redesign internal structure completely, that's why we hope you can help us by heavy testing of current version.
Society
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|
You can use PayPal to to buy a cup of coffee for authors of this site |
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last modified: March, 01, 2021