rsync is a utility software and network protocol for Unix-like systems that synchronizes files and directories from one location to another while minimizing data transfer by using delta encoding when appropriate.

# copy files from remote to local, maintaining file propertires
# and sym-links (-a), zipping for faster transfer (-z), verbose (-v).
$ rsync -avz host:file1 :file1 /dest/
$ rsync -avz /source host:/dest

# Copy files using checksum (-c), rather than time, to detect if the file
# has changed. Useful for validating backups.
$ rsync -avc /source/ /dest/

# --archive          archive mode
# --checksum         skip based on checksum, not mod-time and size
# --progress         show progress during transfer
# --delete           extraneous files from dest dirs
# --delete-excluded  also delete excluded files from dest dirs
# --force            force deletion of dirs even if not empty
# --ignore-errors    delete even if there are I/O errors
# --human-readable   output numbers in a human-readable format
# -- exclude         exludes file(s) from syncing
$ rsync --archive \
        --checksum \
        --progress \
        --delete \
        --delete-excluded \
        --force \
        --ignore-errors \
        --human-readable \
        --exclude '*.pyc' \
        --exclude '.DS_Store' \
        <source_dir> <dest_dir>