How can I make a progress bar while copying a directory with cp?

octosquidopus picture octosquidopus · Aug 20, 2011 · Viewed 49.5k times · Source

I suppose I could compare the number of files in the source directory to the number of files in the target directory as cp progresses, or perhaps do it with folder size instead? I tried to find examples, but all bash progress bars seem to be written for copying single files. I want to copy a bunch of files (or a directory, if the former is not possible).

Answer

SteveLambert picture SteveLambert · Aug 12, 2013

You can also use rsync instead of cp like this:

rsync -Pa source destination

Which will give you a progress bar and estimated time of completion. Very handy.