Rsync (Remote Sync): 10 Practical Examples of Rsync Command in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux course in 5 Days

We are thankful for your never ending support.

Tarunika Shrivastava

I am a linux server admin and love to play with Linux and all other distributions of it. I am working as System Engineer with a Web Hosting Company.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

93 Responses

  1. Ravindra says:

    Hi, really its very helpful .. Thanx for this article

  2. LD says:

    Hi, I want to copy the files from one location to another over WAN. both locations are in two geographical locations. Is it possible to achieve it through RSYNC ??

    • Ravi Saive says:


      Of course yes, rsync will work with any network even both machines are on different network and far from each other, rsync works well.

      • LD says:

        how the source and destination paths are going to be mounted then ?

        • Ravi Saive says:


          Rsync is used to sync files between two servers or transfer files from local to remote and vice-versa, it’s not meant for mounting. Could you explain me more about your questions? so that I can help you more better way..

  3. Alex says:

    Thank you! Really well explained.

  4. ash says:

    Nice post.

  5. Azim Khan says:

    Thanks You very helpful commands for beginners like me but I am looking for copying files using rsync command from one server to another server directly which I did not get. If anybody have please share .

  6. Under RHEL 5.0, there is no argument called “–remove-source-files” instead there is a option called “–remove-sent-files”
    For example: If you are trying to copy the file to a local or remote system, you would use the following command.

    $ rsync –remove-sent-files -avzh /tmp/aziz.tar root@localhost:/tmp/backup1/

    Note: While specifying the destination directory, if the directory is not proceeding with ‘/’ it will create a file called /tmp/backup1. We need to ensure the directory ends with ‘/’ if we want to create the destination directory while runnning rsync.

    Hope it helps

  7. kirba says:

    Thanks for this tutorial. I am a beginner in the server world and i find this quite useful.

    I have some questions and if you can answer that would be great.

    I need to transfer data from one remote server to another.
    rsync -av root@ root@

    is this going to work?
    also is there any option to run rsync command and then log out from my console (leaving rsync in progress). I need to transfer around 150GB and it would be great if i dont have to leave my terminal on.

    Kind regards

    • Ravi Saive says:

      I never tried that way and I am not sure it will work or not, I think you should give a try and see how it works and to keep the session active better run via cron..

    • Matthys Potgieter says:

      Hi, tmux is a great tool for this (as well as screen), for detaching from a running process/terminal and reattaching later. also nohup command may be useful but not as versatile for this purpose, as it demonizes your process and writes to a log file

  8. sandeep says:

    I am new to linux. This site is Really useful..!! Thankx

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 95000+ Linux Users
  1. 77,543
  2. 4,213
  3. 35,218

Enter your email to get latest Linux Howto's