Using rsync over cp: don’t we just love progressbars?

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, September 08, 2009

Follow me on Twitter as @mattiasgeniar

If you need to copy large files in a Linux environment, you would usually use the cp command. Makes sense, since it’s to copy files. The downside: you don’t know how far you are within your copy. You can toggle verbose mode with ‘-v’, so when you’re copying several files you know which are done, but there’s no single-file progress to be seen.

Using rsync, you can. And it’s available on nearly every linux release, too.

Here’s the syntax difference:

cp <oldfile> <newfile>
rsync --progress <oldfile> <newfile>

rsync would then look like this:

rsync

It gives you an estimated time remaining, as well as a speed indication. And it shouldn't affect your total copy time by that much, either.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.