I'm looking for something that will compare directories and files like Beyond Compare does for windows.
Its mainly for use of source control, but I need to use it for deployment as well.
I'm looking for something that will compare directories and files like Beyond Compare does for windows.
Its mainly for use of source control, but I need to use it for deployment as well.
Meld
Meld is a tool that can compare and merge files and directories. It is a GUI analog to the standard
diff
andpatch
command line tools. (See man diff and man patch for more details on those)Also, lots of source control systems (such as
bzr
orgit
) have the ability to create diffs between versions.Diff is your friend.
This will compare all files that are common between path1 and path2.
If you change
-ur
to-urN
then that will also show the contents of files that are only present in one of the paths.'Beyond Compare' is available for Linux, too. Check their download URL.
Their german site is at http://www.beyondcompare.de/.
Use the
diff
command:diff -u
selects a format with a few lines of context. A plaindiff file1 file2
only lists the differing lines. There are many more options to control the output format, ignore whitespace-only differences, etc.If you want to write the output to a file, redirect it:
Gnome Commander
The interface might not be real sexy, but it's extremely powerful!
And if you were used to other *Commander (like Norton, or the likes), you won't be lost.
Command line tools
Inspired by this blog entry.
diff
Listing different files:
Listing also content:
rsync
If the two directories are not on the same machine,
rsync
might be the easiest solution. Usuallyrsync
is used in order to sync directories, but you can run it in verbose and dry mode, so it will only list files it would have to change.You can ommit
c
if you want to compare files based on timestamps and file sizes to speed up everything:KDiff3
It is a graphical front-end to diff for KDE users (or if you don't mind using Qt apps).
There is also dirdiff for directories.
Krusader
Krusader is a free tool (available in the Software Centre) that shows folder contents in comparison and you can synchronize with a lot of different options. You can filter while synchronising and comparing.
To compare file contents you simply mark two files select "file" > "compare content" and they are compared on a letter by letter basis. the default comparing tool used by krusader is the default KDE tool "Kompare". You can set krusader to use any other comparison tool - like for example one of the above.
This is the most complete solution I ever found and it's very convenient. And it supports all the function keybindungs used by midnight commander (norton commander syntax).
Maybe Meld is what you are looking for. Or here are some other alternatives.
I learned about hashdeep two weeks ago. And it has some strong advantages:
meld
, it works well for very large folders. Wheremeld
becomes extremely slow and the UI unresponsive (blocked), hashdeep just works at a constant speedrsync
, hashdeep detects moved files - files with the same content, just in a different directory.Verbose output is like: