DEV Community

Discussion on: MacOS vs Linux — the cp command will trip you up!

Collapse
 
moopet profile image
Ben Sinclair

Something I mentioned in a different comment, rsync behaves the way cp does on a Mac. So for people used to rsync, it's not a surprise, and GNU cp is the surprise!

I think it's telling though that there are so many articles about rsync warning you you can screw up if you don't get the slashes right - the majority of people over the last couple of decades have been used to doing it the GNU way.

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

There's also a reason rsync behaves that way, and it too is something I'd expect. You sync source-directory to destination-directory. As with any other form of syncing, it would be expected that you'd have two folders which are made to match one another.

"Copy X to Y", find X in Y.
"Sync X and Y", find X and Y are identical.

Simple.