I have timed a shell script which does some copying and moving files which usually runs fast but now slowed down because I think a new virusscanner is scanning every file before copying.

time copy.sh

which returns:

1.54s user 24.57s system 1% cpu 16:16.06 total

the man page tells me the following:

The time utility executes and times utility. After the utility finishes, time writes the total time elapsed, the time consumed by system overhead, and the time used to execute utility to the standard error stream. Times are reported in seconds.

What do the 3 time results mean?

The one I'm sure of is 16m16s total time.


user is the CPU time spent in userland, and system the CPU time spent doing, well, system calls. By the description of the program, it's not surprising that the system time would be so high, as the userland code is probably mostly just checking that read(2) and write(2) didn't fail, with the heavy I/O work happening within those system calls. A program that does CPU crunching would instead show low system time and very high user time, as there would only be a few system calls to get the program up, and then lots of userland activity with whatever calculation.

If your system has vmstat(8), vmstat 1 is a good way to see the system-level user and system stats (and other important values, such as context switches).

| improve this answer | |

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.