mac 命令行 复制目录_从命令行复制目录

mac 命令行 复制目录

Copying a directory for the sake of backup is something I do often, especially when I'm trying to figure out why something isn't working when I use an external library.  I'll copy the directory structure as a backup, mess around with the original source until I find a solution, then restore the original and change my overall system code to bring in my revised version.

为了备份而复制目录是我经常要做的事情,尤其是当我试图弄清为什么使用外部库时某些东西无法正常工作时。 我将复制目录结构作为备份,将原始源弄乱,直到找到解决方案,然后还原原始源并更改整个系统代码以引入修订版。

You can't just use cp to copy a directory structure -- you'll see cp: myDir is a directory (not copied).  You'll need to add a few additional flags to copy a directory structure:

您不能只使用cp复制目录结构-您会看到cp: myDir is a directory (not copied). 您需要添加一些其他标志来复制目录结构:


cp -Rp source source_copy


The above command copies the directory recursively while keeping the same permissions!

上面的命令以递归方式复制目录,同时保留相同的权限!

翻译自: https://davidwalsh.name/copy-directory

mac 命令行 复制目录

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值