从xcopy /?
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
但假设我想排除所有.o
文件和包括所有.odt
文件。如果是正则表达式,我可以使用\.o$
。但事实并非如此,不是吗?
我该怎么做?
(我也不反对使用 rsync 或其他东西。)
答案1
你可以尝试机器人复制,该/xf
开关可用于排除特定的扩展。