verify large directory after copy files code example

Example: verify large directory after copy files

###
### Replace /path/to/original with the path of the original directory you copied.
### Replace /path/to/destination with the path of the destination directory you copied to.
### Replace  with the common ancestor directory between both. Example: you are copying from /media/foo/bar to /media/test/dst/, so that dst, after the copy operation is done, has the directory bar. The first common ancestor is bar here; because all files under bar will have the same relative path.
###

find /path/to/original -type f -exec bash -c 'diff -rq --no-dereference "$@" "/path/to/destination/$(sed -r "s/^.*(.*)$/\1/g" <<<"$@")"' bash {} \;

Tags:

Misc Example