一个命令复制多个目录 [英] Copy multiple directories with one command

查看:16
本文介绍了一个命令复制多个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在一个命令中复制多个目录,以减少层数?例如,而不是:

Is there any way to copy multiple directories in one command, to reduce the number of layers? E.g., instead of:

COPY dirone ./dirone
COPY dirtwo ./dirtwo
COPY dirthree ./dirthree

我想做:

COPY dirone/ dirtwo/ dirthree/ ./

但是,这会复制目录的内容...但我想复制目录本身.

However, this copies the contents of the directories... but I want to copy the directories themselves.

推荐答案

这是复制命令的记录行为:

That's the documented behavior of the copy command:

如果 <src> 是目录,则复制目录的全部内容,包括文件系统元数据.

If <src> is a directory, the entire contents of the directory are copied, including filesystem metadata.

注意:目录本身并没有被复制,只是它的内容.

Note: The directory itself is not copied, just its contents.

我可以建议的最佳解决方法是更改​​构建文件夹中的目录布局,将三个文件夹移动到一个父文件夹下并添加父文件夹.

Best workaround I can suggest is to change your directory layout in your build folder, move the three folders under one parent folder and add the parent.

这篇关于一个命令复制多个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆