D
D
Drovosek012021-03-16 12:51:23
bash
Drovosek01, 2021-03-16 12:51:23

How to find files with different hashes in two directories with nested directories?

There are 2 folders in them there are files and subfolders. Some files match in name, but may not match in name. It is also possible that there are files in one or both of the subfolders that do not occur in the other folder.

You need to compare (by hash or in some other way) all files in 2 folders and subfolders and find out which of the files are different (and preferably which of the files are not repeated).

Is there any software that can do this or a bash script or something like that?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey c0re, 2021-03-18
@Drovosek01

under Windows : Total Commander, Unreal Commander, Double Commander
under Linux : Double Commander
function - Commands - Synchronize directories (something like this)
mc and far seem to be able to compare directories as well.
the script is best probably written in python (there is on any OS, although for an amateur), take the example above on VBS (honestly I didn’t read it) or write it in my own way, IMHO - enter the file hashes into an array, then compare (well, something like this )
on bash I suppose it will be a terrible perversion, although I think it is possible.
PS: pure bash is still not enough in bash, you will need at least one external command md5sum , which most likely will not be in Windows and you will need to look for its port for Windows or an analogue. There is also diff which could be used, but again, this is not a bash builtin.
also
GTBACKUP
by rSync : have
you tried searching at all? rsync windows
cwRsync
https://habr.com/ru/sandbox/48269/
https://rsync.samba.org/
or even Cygwin with all the relevant goodies.
although, Windows 10 has an entire Linux subsystem - WSL

S
SOTVM, 2021-03-16
@sotvm

Well, for starters, filter at least by size,
then, from a smaller pile, compare.
md5 works fast (man md5sum) if you don't have 100500 million files )))

F
FAN2 tom, 2021-03-16
@FAN2tom

Total Commander can compare directories. Also there is a functionality "display all files without directories". Alternatively, the algorithm is as follows:
1. Select the desired folder with subfolders on one panel and use the command "show all files without directories".
2. On the second panel, do the same with the second folder.
3. Select the "compare directories" command.
The comparison is primitive (not by hashes) and there may be different nuances, so this is suitable for a rough comparison.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question