Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to measure the execution time of a process that I call via the command line (i.e., I want to find out how long it takes to for the process to finish). Is there any command that I can add to the command calling the process that will achieve this?

share|improve this question

migrated from Jul 17 '11 at 12:35

This question came from our site for professional and enthusiast programmers.

Add time before the command you want to measure.

The output will look like:

real    0m0.606s
user    0m0.000s
sys     0m0.002s

Explanation on real, user and sys (from man time):

Elapsed real (wall clock) time used by the process, in seconds. / Total number of CPU-seconds that the process used directly (in user mode), in seconds. / Total number of CPU-seconds used by the system on behalf of the process (in kernel mode), in seconds.

share|improve this answer
Thank you, that helped a lot! – user848635 Jul 17 '11 at 12:34
@ninjalj, can you provide more information on what the real, user, and sys times are that this command returns? – Christopher Kyle Horton Jul 17 '11 at 20:22
@JacobVlijm This answer isn't that elaborate. :) You could edit in your comment and make it so. – muru Feb 13 '15 at 16:43

You can use time:

time ls -R
share|improve this answer
date +"%T" && cp -r ./file  /destination/folder/here && date +"%T"

Running this command in the terminal will give you the total time for coping a file

share|improve this answer

Your Answer


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