Comments on: How to Find Difference Between Two Directories Using Diff and Meld Tools https://www.tecmint.com/compare-find-difference-between-two-directories-in-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Wed, 26 Jul 2023 06:26:19 +0000 hourly 1 By: Ravi Saive https://www.tecmint.com/compare-find-difference-between-two-directories-in-linux/comment-page-1/#comment-2038743 Wed, 26 Jul 2023 06:26:19 +0000 http://www.tecmint.com/?p=25525#comment-2038743 In reply to Luis Gutiérrez López.

@Luis,

Yes, that’s correct. The rsync --dry-run option allows you to run a trial run of rsync without actually transferring any files. This is a great way to compare two directories and see which files are different.

The syntax for the rsync --dry-run command is as follows:

# rsync --dry-run [options] source_directory destination_directory

For example, to compare the contents of the /home/user/source directory to the /home/user/destination directory, you would use the following command:

# rsync --dry-run /home/user/source /home/user/destination
]]>
By: Luis Gutiérrez López https://www.tecmint.com/compare-find-difference-between-two-directories-in-linux/comment-page-1/#comment-2037471 Mon, 24 Jul 2023 08:47:44 +0000 http://www.tecmint.com/?p=25525#comment-2037471 Helpful!

You can also perform the comparison through rsync using the --dry-run parameter so that it only shows the differences, but without doing anything.

]]>
By: Ravi Saive https://www.tecmint.com/compare-find-difference-between-two-directories-in-linux/comment-page-1/#comment-2036162 Fri, 21 Jul 2023 05:26:38 +0000 http://www.tecmint.com/?p=25525#comment-2036162 In reply to Aashish.

@Aashish,

Yes, you can use the diff command to compare files or directories on a remote host (B server) with the local files or directories on your current machine (A server).

To achieve this, you can use the ssh command along with diff to run the comparison remotely.

Assuming you want to compare the contents of two directories: /path/to/dir1 on A server and /path/to/dir2 on B server, you can use the following command:

$ ssh user@B_server "diff -r /path/to/dir2 /path/to/dir1"
]]>
By: Ravi Saive https://www.tecmint.com/compare-find-difference-between-two-directories-in-linux/comment-page-1/#comment-2036161 Fri, 21 Jul 2023 05:24:16 +0000 http://www.tecmint.com/?p=25525#comment-2036161 In reply to Kepoks.

@Kepoks,

You are correct, Kompare is another excellent file comparison tool, but it is good for code comparison and small-scale file merging tasks.

]]>
By: Ravi Saive https://www.tecmint.com/compare-find-difference-between-two-directories-in-linux/comment-page-1/#comment-2036160 Fri, 21 Jul 2023 05:23:10 +0000 http://www.tecmint.com/?p=25525#comment-2036160 In reply to Kepoks.

@Kepoks,

Thank you for bringing up KDiff3, which is indeed a great alternative to Meld and an excellent graphical file and directory comparison tool.

]]>