Linux time command

Updated: 04/26/2017 by Computer Hope

About time

Report how long it took for a command to execute.


The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard output giving timing statistics about this program run. These statistics consist of:

  • The elapsed real time between invocation and termination.
  • The user CPU time.
  • The system CPU time.

time syntax

time [-p] command [arguments...]


-p If -p is specified, the timing summary is printed in a portable POSIX format.

time examples

time df

Calculates free disk space using the df command, and reports how long it took for the command to complete. Output of this command would resemble the following:

Filesystem    1K-blocks    Used Available Use% Mounted on
rootfs          7867856 3694744   3773448  50% /
udev              10240       0     10240   0% /dev
tmpfs            207456     580    206876   1% /run
tmpfs              5120       0      5120   0% /run/lock
tmpfs            493340      84    493256   1% /run/shm

real    0m0.116s
user    0m0.004s
sys     0m0.008s

csh — The C shell command interpreter.
date — Output the current date and time.
timex — Report process data and system activity for a specified command.