Celeb Glow
updates | March 31, 2026

Is there any advantage to Rsync moving files on the same machine?

I was reading how to install Magento on Digital Ocean Ubuntu 14.04 VPS. All files are on the server. the author says:

We will use rsync to transfer our Magento files there, since rsync will include important hidden files like .htaccess. Once the transfer is complete, we can clean up our home directory by deleting the magento folder and archive there.

sudo rsync -avP ~/magento/. /var/www/html/

rsync will safely copy all of the contents from the directory that you unpacked to the document root at /var/www/html/.

i've been using Linux for a long long time and never used Rsync to move files on the same machine, and never encoutered the problems mentioned by the author. Digital Ocean hires professional authors so there might be a point behind his claims.

Is there an advantage to using Rsync over mv or cp, when moving files on the same machine?

4

1 Answer

I assume the point is to transfer the content of magento to /var/www/html. That's to say, if we had:

magento
├── .bar
└── foo

We'd get:

html
├── .bar
└── foo

This is annoying, but not difficult, to accomplish this with mv. You'd have to use some form of find, or enable dotglob in bash, to include the .bar.

rsync is simpler.

With find:

find magento -mindepth 1 -maxdepth 1 -exec mv -t /var/www/html {} +

With dotglob in bash:

shopt -s dotglob
mv magento/* /var/www/html
4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy