Skip to content

Instantly share code, notes, and snippets.

@romanhaa
Last active June 4, 2021 07:56
Show Gist options
  • Save romanhaa/25079bd8653e8c1f392de704c48097ee to your computer and use it in GitHub Desktop.
Save romanhaa/25079bd8653e8c1f392de704c48097ee to your computer and use it in GitHub Desktop.
Copy files/directories with `rsync`
# copy directory from A to B
rsync -ah --info=progress2 <DIR_SOURCE> <DIR_TARGET>
# copy directory from A into B
rsync -ah --info=progress2 <DIR_SOURCE> <PARENT_OF_DIR_TARGET>/
# copy content of directory A into B
rsync -ah --info=progress2 <DIR_SOURCE>/ <DIR_TARGET>/
# copy directory from A to B on remote machine
rsync -ah --info=progress2 <DIR_SOURCE> <REMOTE>:<DIR_TARGET>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment