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 DESTINATION

Parameters & Attributes

NameTypeDescription
SOURCEoperandSource file or directory
DESTINATIONoperandTarget path
-aoptionArchive mode
-noptionDry run
-ioptionItemized 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'
Linux Reference