익명 04:14

How to show the transfer progress and speed when copying files with cp?

How to show the transfer progress and speed when copying files with cp?

Otherwise, is there any alternative command line utility that can achieve this?



Top Answer/Comment:

There isn't any progress or speed indicator in cp. See here as to why. Although it does more than you need, rsync has a --progress parameter. The -a will keep permissions, etc, and -h will be human readable.

rsync -ah --progress source destination

The output will look something like this:

Pictures/1.jpg
      2.13M 100%    2.28MB/s    0:00:00 (xfr#5898, to-chk=1/5905)
Pictures/2.jpg
      1.68M 100%    1.76MB/s    0:00:00 (xfr#5899, to-chk=0/5905)

Community edit:

Currently this is the highest voted answer, yet in the comments there is a strong consensus about a major improvement that had not yet been included in the answer:

Instead of --progress, one can use --info=progress2, which produces a different result, that in terms of user experience / ergonomy appears to be a closer match to what people expect from a progress / status bar.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다