Preview an exact rsync directory mirror with deletions
Build a paste-ready command, then review its compatibility and effects before running it.
rsync -avhn --delete --itemize-changes <source> <destination>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsrsyncrsync must be installed and available on PATH.
Version supportrsync Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals>f+++++++++ assets/app.jsRepresentative successful output; values vary with the selected target and system state.
Known errorsrsync: command not foundrsync is missing or is not available on PATH.
Verifyrsync -avhn --delete --itemize-changes {{source}} {{destination}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01rsyncCommandRuns the rsync stage of this one-liner.
02-avhnOptionCombines archive mode, verbose output, human-readable sizes, and a dry run.
03--deleteOptionRemoves destination entries that are absent from the source.
04--itemize-changesOptionPrints a compact change code for every affected path.
05<source>ParameterA value supplied in the Fill parameters section.
06<destination>ParameterA value supplied in the Fill parameters section.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
rsync -avhn --delete --itemize-changes ./site/ backup:/srv/site/
Example output
>f+++++++++ assets/app.js
*deleting assets/old.js
.d..t...... ./
sent 1,204 bytes received 98 bytes
Illustrative output — exact values vary by system and data.
Official sources