LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.



time

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.

F

Number of major (I/O-requiring) page faults.

I

Number of filesystem inputs.

k

Number of signals delivered to the process.

K

Average total (data+stack+text) memory use, in kilobytes.

M

Maximum resident set size, in kilobytes.

O

Number of filesystem outputs.

p

Average unshared stack size, in kilobytes.

P

Percent of CPU used.

r

Number of socket messages received.

R

Number of minor (recoverable) page faults.

s

Number of socket messages sent.

S

Total CPU seconds used by the system on behalf of the process.

t

Average resident set size, in kilobytes.

U

Total CPU seconds used directly by the process.

w

Number of voluntary context switches.

W

Number of times the process was swapped out of main memory.

x

Exit status of the command.

X

Average shared text size, in kilobytes.

Z

System page size, in bytes.

Example

Time the execution of the command ls -l and display the user time, system time, and exit status of the command:

/usr/bin/time -f "\t%U user,\t%S system,\t%x status" ls -Fs


Linux Resources
  • Linux Online
  • The Linux FAQ
  • linux.java.net
  • Linux Kernel Archives
  • Kernel Traffic
  • DistroWatch.com


  • Sponsored by: