Linux time command
Updated: 05/04/2019 by Computer Hope
On Unix-like operating systems, the time command reports how long it took for a command to complete execution.
This page covers the GNU/Linux version of time.
Description
The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard error 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.
Syntax
time [-p] command [arguments...]
Options
-p | If -p is specified, the timing summary is printed in a portable POSIX format. |
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
Related commands
csh — The C shell command interpreter.
date — Output the current date and time.
timex — Report process data and system activity for a specified command.