如何使用Linux命令将一个目录复制到多个目录?

时间:2022-04-24 01:23:15

If I have a directory name '1' (without quotes) and want to copy that directory (with its contents) to many directories name '2' to '70', how do this using Linux commands?

如果我有一个目录名称'1'(没有引号)并且想要将该目录(及其内容)复制到许多目录名称'2'到'70',那么如何使用Linux命令?

1 个解决方案

#1


1  

so, each copy will only do once, but (in bash at least)

所以,每个副本只会做一次,但(至少在bash中)

for x in $(seq 2 70); do cp -r 1 $x; done

should do it

应该这样做

#1


1  

so, each copy will only do once, but (in bash at least)

所以,每个副本只会做一次,但(至少在bash中)

for x in $(seq 2 70); do cp -r 1 $x; done

should do it

应该这样做