Name

time

Synopsis

time [options] command [arguments]

Run the specified command, passing it any arguments, and time the execution. Note that there is also a shell time command, so you might need to specify the full path, usually /usr/bin/time, to run this version of time. time displays its results on standard error. The output includes elapsed time, user CPU time, system CPU time, and other information such as memory used and number of I/O operations. The output can be formatted using printf format strings specified with the -f option or the TIME environment variable.

Options

--

The end of the options. Anything after the -- is treated as the command or one of its arguments.

-a, --append

Used with -o to append the output to file instead of overwriting it.

-f format, --format=format

Specify the output format. Overrides any format specified in the TIME environment variable.

--help

Print help message and exit.

-o file, --output=file

Send the output from time to the specified file instead of to standard error. If file exists, it is overwritten.

-p, --portability

Use portable output format (POSIX).

-v, --verbose

Give verbose output, providing all available information.

-V, --version

Print version information and exit.

Resources

The following resources can be specified in format strings:

c

Number of involuntary context switches because of time slice expiring.

C

Name and arguments of command being timed.

D

Average size of unshared data area, in kilobytes.

e

Elapsed real time, in seconds.

E

Elapsed real time as hours:minutes:seconds ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.