gpt4 book ai didi

shell - UNIX:复制整个目录结构并且只复制特定的文件类型

转载 作者:行者123 更新时间:2023-12-04 18:46:52 25 4
gpt4 key购买 nike

我如何重新创建整个目录结构并仅复制扩展名为 .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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com