【发布时间】:2018-09-13 05:08:26
【问题描述】:
我正在尝试将以下 robocopy 命令移植到 Linux:
robocopy SrcDir DstDir *.dll *.pdb *.xml /xf Unity*.* nunit*.*
换句话说,我想:
- 包括所有
dll、pdb和xml文件 -
除非它们以
Unity或nunit开头
我已经阅读了以下两个主题,但无法确定确切的语法:
- Copy all files with a certain extension from all subdirectories
- How to use 'cp' command to exclude a specific directory?
到目前为止,我的最佳猜测是:
- 启用
shopt -s extglob - 进入源目录
cd SrcDir - 使用此命令:
cp ((*.dll | *.pdb | *.xml) && !(Unity*.* | nunit*.*)) DstDir
但我的条件表达式中出现语法错误,从 *.dll 开始。
【问题讨论】: