网站管理员
我想运行以下命令
./mc cp --recursive local//first/second remote//first/second
我想遍历local//first
并找到所有目录并./mc cp
为每个目录运行
我怎样才能做到这一点?
塞弗
如果local//first
仅包含目录,那么它应该对您有用:
./mc cp -r local//first/* remote//first
对于一般情况,您还可以使用find
列出所有目录:
find local//first -type d
然后使用此列表执行任何操作,-exec
或将其发送到xargs
:
find local//first -type d -path "local//first/*" -prune -exec ./mc cp --recursive {} remote//first \;
在文档中了解更多信息(find,xargs)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
编辑于
我来说两句