I, for one, will keep using scp. Rsync’s interface is too different, with a lot of subtle differences which constantly catches me off guard.
When was, for example, the last time a non-rsync tool cared about whether you included the trailing slash or not for a path to a directory on a GNU system? Why did rsync decide to completely break with the convention? For most people, I bet the behavior of rsyncing directories mostly depends on whether their tab completion happens to include a trailing slash or not.
Why did rsync decide to completely break with the convention?
What convention? It follows the SUS/Posix convention, try mv’ing a file to dir or dir/ and note the difference. dir/ is the same as dir/. and implies something different. Its also to handle cases where symlinks may be present to return ENOTDIR.
I don’t see a difference between mv <file> <dir> and mv <file> <dir>/? In both cases, <file> is ends up as <dir>/<file>.
I’m not talking about destinations though, but source. cp foo/ bar and scp foo/ bar will both copy the directory foo to bar such that bar/foo is a directory with the contents of the old foo directory, but rsync foo/ bar will copy all the contents offoo into bar, like cp foo/* bar would do.
I don’t see a difference between mv and mv /? In both cases, is ends up as /.
Depends on if something exists or not.
$ mkdir /tmp/demo
$ cd !$
cd /tmp/demo
$ touch foo
$ mkdir dir
$ mv foo bar/
mv: rename foo to bar/: No such file or directory
zsh: exit 1 mv foo bar/
Specifying bar/ here indicates there should be a directory to move to. But its not there.
but rsync foo/ bar will copy all the contents of foo into bar, like cp foo/* bar would do.
Correct, becuase foo/ is the same as foo/. which means copy the contents of foo/. to the destination. Just as foo without a / indicates you want the directory itself (and contents therein) copied to the destination. That follows cp as well.
cp foo/ bar and scp foo/ bar will both copy the directory foo to bar such that bar/foo is a directory with the contents of the old foo directory
You sure about that? Show your cards as thats not how cp works on any unix i’ve used example from my laptop:
I don’t know man. All I can say is that rsync works differently from cp and scp and it constantly messes me up. If you’re unhappy with my explanation of how it’s different, I’m sorry.
I, for one, will keep using scp. Rsync’s interface is too different, with a lot of subtle differences which constantly catches me off guard.
When was, for example, the last time a non-rsync tool cared about whether you included the trailing slash or not for a path to a directory on a GNU system? Why did rsync decide to completely break with the convention? For most people, I bet the behavior of rsyncing directories mostly depends on whether their tab completion happens to include a trailing slash or not.
What convention? It follows the SUS/Posix convention, try mv’ing a file to dir or dir/ and note the difference. dir/ is the same as dir/. and implies something different. Its also to handle cases where symlinks may be present to return ENOTDIR.
Ref: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13 https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_13 https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap03.html#tag_21_03_00_75
I don’t see a difference between
mv <file> <dir>
andmv <file> <dir>/
? In both cases,<file>
is ends up as<dir>/<file>
.I’m not talking about destinations though, but source.
cp foo/ bar
andscp foo/ bar
will both copy the directoryfoo
tobar
such thatbar/foo
is a directory with the contents of the oldfoo
directory, butrsync foo/ bar
will copy all the contents offoo
intobar
, likecp foo/* bar
would do.Depends on if something exists or not.
Specifying bar/ here indicates there should be a directory to move to. But its not there.
Correct, becuase foo/ is the same as foo/. which means copy the contents of foo/. to the destination. Just as foo without a / indicates you want the directory itself (and contents therein) copied to the destination. That follows cp as well.
You sure about that? Show your cards as thats not how cp works on any unix i’ve used example from my laptop:
I don’t know man. All I can say is that rsync works differently from cp and scp and it constantly messes me up. If you’re unhappy with my explanation of how it’s different, I’m sorry.
I’ve always preferred sftp anyway but I suppose it doesn’t work well for some people’s workflows.
Is rsync still single threaded?
Yeah, just like scp.