Skip to content

Instantly share code, notes, and snippets.

@BigW72
Created December 10, 2023 15:01
Show Gist options
  • Save BigW72/c6250636c3ad43ba4c99fa7dbb1cb863 to your computer and use it in GitHub Desktop.
Save BigW72/c6250636c3ad43ba4c99fa7dbb1cb863 to your computer and use it in GitHub Desktop.
rsync trailing slash

From https://unix.stackexchange.com/questions/402555/why-add-a-trailing-slash-after-an-rsync-destination

It does make a difference when the source is a file and the destination directory does not exist. For instance take a file called file as source:

$ rsync file dest/ will create a copy of file inside a directory dest, whereas

$ rsync file dest will make a copy of the file file called dest

To add (from the comments); if a directory dest already exists, a copy file will be created in dest in both cases above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment