gpt4 book ai didi

macos - 如何在 Mac OS X 上模拟 'cp --update' 行为?

转载 作者:行者123 更新时间:2023-12-04 00:33:53 25 4
gpt4 key购买 nike

GNU/Linux version of cp 有一个不错的--update旗帜:

-u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing



Mac OS X version of cp 没有这个标志。

获得 cp --update 行为的最佳方法是什么?通过使用内置的系统命令行程序?我想避免安装任何额外的工具(包括 cp 的 GNU 版本)。

最佳答案

rsync 有一个 -u/--update与 GNU 一样工作的选项 cp :

$ rsync -u src dest

关于macos - 如何在 Mac OS X 上模拟 'cp --update' 行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1132508/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com