我如何重新创建整个目录结构并仅复制扩展名为 .txt 的文件(如果存在)。我想复制目录或子目录,即使它是空的。
最佳答案
这是一行命令:)
rsync -vapEtogR --progress --stats --log-file="log_file_name.txt" --include '*/' --include '*.txt' --exclude '*' source_path/ destination_path/
使用
rsync --help
了解使用的选项。
关于shell - UNIX:复制整个目录结构并且只复制特定的文件类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32278901/