Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'm having problems when copy large files using nautilus (it gets stuck) so I need to copy using cp. I would like to know if there is any parameter that shows the % copied and also the transfer speed.

share|improve this question
You could use rsync instead of cp. It has a --progress option. –  frostschutz Feb 17 '13 at 14:15
Midnight Commander also works well, and has a pretty text-based UI with progress bars, but might not be installed. Try mc on the command prompt. Also, obviously, it's not cp. –  Michael Kjörling Feb 17 '13 at 14:24
Using rsync with --progress just made me figure out what is happening. It gets stuck when it reaches the 100%, and then last a couple of minutes in end up. I think is the same that is happening with nautilus. Anyway that is another question already, so the best answer for this question is the rsync --progress, it shows size, %, speed and elapsed time. –  yzT Feb 17 '13 at 15:16
I have a question about the rsync --progress. Assume that I have the directory A with files a and b and the empty directory B, when I copy A to B it shows the progress of each file, i.e. the progress of a and the progress of b. Is there any way to show the overall progress? –  yzT Feb 17 '13 at 15:33
one problem with rsync is that it runs slower than a pure copy. On my big server, the difference is 60MB/s and 300MB/s respectively. –  pdwalker Nov 15 '14 at 17:37

8 Answers 8

If you allow other tools than cp it's surely possible. For a single file you can use pv. It's a small tool providing nice statistics.

pv inputfile > outputfile

If you have multiple files or directories you can use tar:

tar cf - sourceDirectory | pv | (cd destinationDirectory; tar xf -)

You can wrap it in a shell function. It's less to type and you get semantics close to the ones of cp. Here's a very simple (and not error-proof!) function:

cpstat () {
  tar cf - "$1" | pv | (cd "$2";tar xf -)

You call it like this

cpstat sourceDirectory destinationDirectory

You can enhance it further, so that pv provides an estimation of the remaining time.

Another solution (as frostschutz mentioned in a comment) is to use rsync with the --progress option:

rsync --progress -a sourceDirectory destinationDirectory
share|improve this answer
cpstat is going in the pastebin =) –  Matt Feb 17 '13 at 14:57
This will give you transfer speed, but not ETA, because pv doesn't know how much data will come through the pipe. You can specify this using -s. E.g. first do du -sh sourceDirectory to get a (rough) idea, and then pass it to pv, like this: pv -s 100m. –  Jan Fabry May 11 '14 at 15:25
--info=progress2 gives you directory level progress statistics. –  Rawrgulmuffins Dec 5 '14 at 23:40
vbuf (debian, ubuntu) is a good bit faster than pv, probably because of its virtual ring buffer –  Skaperen yesterday
@Skaperen I don't know vbuf. But as it seems it is in Debian unstable at the moment and therefore often not available on Servers which are usually running Debian stable. –  Marco yesterday
up vote 41 down vote accepted

Rsync has a flag called progress2 which shows the overall %.

rsync --info=progress2 source dest

share|improve this answer
--info=progress2 still hasn't made it into a default repository and here it is 2015. Seems like a good idea. –  Lonniebiz Apr 1 at 8:27
--info=progress2 finally included on version 3.1.0 protocol version 31. Maybe you could edit your answer, yzT. –  Sopalajo de Arrierez May 9 at 21:14

rsync works the best for showing the progress during the copying progress.


rsync -avh --progress sourceDirectory destinationDirectory
share|improve this answer

As explained in other answers, cp doesn't provide that functionality. However, progress (formerly called cv) is a small tool which is very helpful in providing this missing feature.

This tool can be described as a Tiny Dirty Linux Only* C command that looks for coreutils basic commands (cp, mv, dd, tar, gzip/gunzip, cat, ...) currently running on your system and displays the percentage of copied data.

I've been using it for the past few months and it's solid.

share|improve this answer
doesn't seem to work with all filesystems (e.g. cifs) but +1, didn't know such crazy ting exits –  akostadinov Mar 8 at 17:23
Note that this project is now called "progress - Coreutils Progress Viewer (formerly known as cv)". –  chappjc Oct 2 at 17:34

Noticed this posting was somewhat old. But as I made a solution to the issue at hand, I thought I'd post my solution.

Scenario: We have a very large directory-structure we want to copy, so we issue the command cp -R sourcedir destdir in one terminal window.

Open another terminal window or push the process to the background (Ctrl+Z,bg<CR>), then let's make a progress indicator the ghetto way:

We first get the total size of the directory structure we want to copy, you do this with:

du -sh /path/sourcedirectory/

Convert the result to gigabytes (G), then substitute the n for the result you got in the variable sourcesize. Once you've inserted the sourcesize and destdir (destination directory), run the command below.

while true; do sourcesize=n destdir=/path/destinationdirectory/ copyprogress="$(export | du -sh $destdir | awk '{print $1}' | sed 's/[^0-9.]*//g' )" ; echo "scale=3 ; $copyprogress / $sourcesize * 100" | bc | xargs echo -n ; echo % completed ; sleep 10 ; done

This will print the progress every 10 seconds with messages like:

0.100% completed
0.200% completed
0.300% completed 
... etc

I'm aware that this solution did not address the speed of copying, but it would be possible to add that by by expanding the commands above, possibly making it into a bash script so it would be easier to read. For instance by checking how much data is copied pr. n time unit, the speed should be trivial to calculate and display.

share|improve this answer
This is actually perfect for my use case, so thanks for posting it! I want to know about the progress of copying a huge directory with thousands of files, not just one file, so the other solutions don't really help me. –  Ibrahim Apr 10 at 18:09

Not in a standard version of cp.

You could background the cp and list the size while waiting for cp to finish.

I use this perl to monitor growth of a single file but it runs externally to the cp (or whatever else I'm doing)

share|improve this answer

To improve on Marco's answer, today I wrote this version of cpstat, so you can copy many directories and use the last parameter as the destination path. Note that if you use a relative deep path as source, you can, thanks to tar, automatically create the same dependent directory tree.

function cpstat () {

    tar -cf - "${@: 1: $#-1}" |
    pv -s "$( du -cs -BK --apparent-size "${@: 1: $#-1}" |
              tail -n 1 |
              cut -d "$(echo -e "\t")" -f 1)" |
    ( cd "${@: $#}"; tar -xf - )

share|improve this answer

This tool is a Linux utility command that looks for coreutils basic commands (cp, mv, dd, tar, gzip/gunzip, cat, etc.) currently running on your system and displays the percentage of copied data:

share|improve this answer
This has already been suggested by @AmrMostafa in Nov '14. –  Dubu May 12 at 13:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.