How to Copy Directory Using rsync

You can copy a directory on your Linux system using rsync command.

rsync -avzh /source_dir/ /target_dir/

 

If you want to delete the source_dir you can use the following command.

mkdir -p empty_dir/

rsync -a –delete empty_dir/ source_dir/

Leave a comment