tags:

views:

277

answers:

1

The GNU/Linux version of cp has a nice --update flag:

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

The Mac OS X version of cp lacks this flag.

What is the best way to get the behavior of cp --update by using built-in system command line programs? I want to avoid installing any extra tools (including the GNU version of cp).

+5  A: 

rsync has an -u/--update option that works just like GNU cp:

$ rsync -u src dest
Noah Medling