Zen*_*Zen 1 command-line file-copy files
我有一个 git 目录,里面有很多 python 文件(和一些像 .git 这样的特殊文件)。
我只想将这些 python 文件复制到另一个目录,目录结构不变。
怎么做?
您将收到destination_dir
带有完整路径的文件/
find /path/git_directory -type f -iname "*.py" \
-exec cp --parents -t /path/destination_dir {} +
Run Code Online (Sandbox Code Playgroud)
其他解决方案是 rsync
rsync -Rr --prune-empty-dirs \
--include="*.py" \
--include="**/" \
--exclude="*" \
/path/git_directory /path/destination_dir
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
152 次 |
最近记录: |