For example, when you copy large files, it checks if the files are already at the destination location and copies only the parts that are new or have changed. Another useful feature of rsync is that, when you use it to copy directories, you can exclude files in a systematic way.
The basic syntax of the command is just like rcp:
rsync source target
For example
rsync /data/*.doc comp1:/home/jk/docs/
copies all files with extension doc to the directory /home/jk/docs/ on the computer comp1. The "*" matches any sequence of characters.
To copy directories you use the "-r" (recursive) option. The following command copies the directory "data" to the directory "/home/jk/docs/" on machine comp1:
rsync -r /data comp1:/home/jk/docs/
To exclude certain files you can use the "--exclude" option. In the following command all files that end with ".jpg" are excluded:
rsync -r --exclude="*.jpg" /data comp1:/home/jk/docs/
To exclude files from the excluded list you use the "--include" option:
rsync -r --exclude="*.jpg" --include="*keep*" /data comp1:/home/jk/docs
In this case only files whose name ends with ".jpg" and does not contain "keep" are excluded from copying.
This feature comes in handy for example when you want to copy a directory that contains large files that you don't really care about. For more information see the rsync man page.

