A few days ago I had to copy a very heavy directory, of about 1TB in total.
Before delete the original ones I wanted to compare if all the structure of them were well copied. For this kind of job we have good visual tools, like Meld or payed solutions like Beyond Compare (a friend’s favorite one, but he uses Mac, so…). Both of them are very good tools and, of course, they have many other functions than only compare directories. Here you can find other options, but I only have experience with the ones that I mentioned before.
Anyway, the problem is that for such heavy directories, these tools are not the best option. If you only want to know if all files and directories were copied, without more details, you can use some useful bash commands (in Linux, Mac or some Linux on Windows).
We can use diff to compare:
$ diff -qr dirA dirB
But diff reads all the lines in the files in order to obtain the comparison. So, if we are talking about almost 1TB, it should not be the best option. However, it could be used in combination with other commands to obtain faster an acceptable result.
We can start by listing all files of both directories we want to compare and store the results in txt files. For example, if you want to compare directories /home/user/A and /home/user/B we can:
# Enter to directory A $ cd /home/user/A # Get the list of files, sort and store $ find . -type f | sort > /tmp/dirA.txt # The same for directory B $ cd /home/user/B $ find . -type f | sort > /tmp/dirB.txt
And now we can compare the both lists with diff:
$ diff /tmp/dirA.txt /tmp/dirB.txt
If diff does not find any difference, we can conclude that at least all files were (maybe well) copied.
Additional information:
$ man diff $ man find