I just run a copy command for two large directories with a small number of huge files and I see my cp process is consuming around half a core in top:

51116 root      20   0  110m  876  688 D 43.9  0.0   3:23.83 cp -i -r 165 178 temp       

Why does the cp process consume any cpu? I would imagine it spends most of it's time waiting on disk...

Thx, Boaz


if you check the percentages, at the top of the screen, you'll see that it's mostly on %wa (waiting) and %id (idle), and very little (if any) in %us(userspace).

but at the process line, all the time it spends idly waiting for a given process is charged to that process. if another CPU-heavy process was running at the same time, it would take most of the CPU without affecting the copy task, because it would use the %id and %wa time.


It is managing the move. This includes finding the files, creating new files, and copying them. All this takes some CPU time. Due to the way files are buffered, it may be possible to this very quickly with the file writes occurring asynchronously to the copy operation. If the files aren't buffered, then the CPU utilization can be quite low while files are accessed.

  • This is a good point. cp doesn't only get used to copy ONE file sometimes it copies a whole disk or a folder with thousands of files. – Warren P Jun 24 '19 at 21:07

Your Answer

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

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