In Linux you can use diff command to find the differences in file.
What is interesting is that you can use “diff -u” to list the differences with ‘+’ and ‘-’ rather than sometimes confusing ‘>’ and ‘<’.
An interesting article on finding the difference in files can be read here.
For reference:
Visual Diff Tools in Linux
Command Line:
sdiff file-1 file-2

This is a much more elegant tool compared to diff, if you are looking for a quick command-line utility that shows the difference between two text files. While using it on big files, its better to pipe the output to less command.
sdiff file1 file2 | less
Disadvantage – this is a read-only output. No editing or merging is possible. But its a great tool for a quick visual inspection.
Update: Use sdiff -o out_file file1 file2
vimdiff 
This can open “n” number of files in a vertically split vim environment. This has color highlighting to specify the areas that differ in the file. Editing is possible. This is a complete vim-environment, so all the vim keys are usable.
Emacs:
M-x ediff-buffers
This is an emacs equivalent of vimdiff with copy to left, copy to right, merge changes and much more. This is a special ediff mode which has its own key bindings. Hit ? to get help on the keyboard shortcuts.
Colored highlighting for distinguishing differences. Easy navigation to diff regions.
A maximum of 3 files can be compared and merged. Both comand-line and gui mode are available.
Visual Tools:
Can compare two or three files and allows editing. The differences are dynamically updated. This can work with version control systems like CVS, SVN etc. Folder comparison is possible.
Multi-platform visual diff and merge tool. Has a three-pane view for comparing two-files and the third pane to view the merged output file. Works in Window, Linux and Mac OS X. Folder comparison is possible.
I am sure there are more tools out there (such as xxdiff) but I don’t feel like reviewing them (too ugly).
**Update:
Taken from the kdiff3′s website.
Thanks to the anonymous commenter. An excellent tool from the kde bunch. I loved it. Has the option to compare 2 or 3 files. Has an extra window pane to look at the out of the merged file. Directory differences and merging are possible.
Technorati Tags: Linux, diff, sdiff, vimdiff,
Diff Linux command — Find the difference in files the easier way.| Hot: |
You are welcome to my blog. Please feel free to share your Good or Bad experiences with me through comment or through email.
Originally posted 2008-10-07 10:42:27.
related post
Facebook comments:
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL

























