📌  相关文章
📜  复制文件后验证大目录 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:35.957000             🧑  作者: Mango

代码示例1
###
### 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 {} \;