commands
rsync — Synchronize file trees
Synchronize files locally or through an authorized remote transport. -a preserves many attributes, -n previews, -i itemizes. Source slash changes nesting. Zero means success; nonzero statuses indicate errors including partial transfer. Avoid deletion flags by default. Use a fresh private workspace; live operations are VM-only.
Formal Syntax & Structure
linux syntaxlinux
rsync [OPTIONS] SOURCE DESTINATIONParameters & Attributes
| Name | Type | Description |
|---|---|---|
| SOURCE | operand | Source file or directory |
| DESTINATION | operand | Target path |
| -a | option | Archive mode |
| -n | option | Dry run |
| -i | option | Itemized changes |
Return Value
exit status and output
Synchronize files locally or through an authorized remote transport. -a preserves many attributes, -n previews, -i itemizes. Source slash changes nesting. Zero means success; nonzero statuses indicate errors including partial transfer. Avoid deletion flags by default.
Working Example
Example Snippetlinux
rsync -a source/ dest/cmp source/note.txt dest/note.txt && printf 'verified\n'