logoalt Hacker News

pluc • last Saturday at 12:02 PM • 4 replies • view on HN

The worst is when things behave different when you give them `~/somedir` vs `~/somedir/`. I think it's rsync that does that


Replies

GrantMoyer • last Saturday at 1:12 PM

I really like this feature of rsync (trailing "/" means copy the directory contents to the dest, no trailing "/" means copy the directory itself). Other tools, like cp, don't have any way at all to say copy the directory contents to the dest, and for those tools the result depends on whether or not the destination already exists and is a directory (you might end up with a duplicate nested directory). Rsync produces the same result whether the destination already exists or not.

mjmas • last Saturday at 12:45 PM

rsync, or at least the version I had would behave differently for 'rsync a b' vs 'rsync a/ b/', even though I added the slash for both sides.

IshKebab • last Saturday at 12:34 PM

And `cp`.

amelius • last Saturday at 12:06 PM

Yes, into versus onto. Luckily we have AI to write our command lines.