time(1)

๐Ÿ’– time(1) โ€” like, the manual page but make it make sense ๐Ÿ’–

okay bestie, gather round, because we're talking about time(1) from the General Commands Manual and honestly? she's iconic. she's the girl who tells you how long your little command took to do its thing. no cap.


โœจ NAME โœจ

time โ€” time a simple command or give resource usage


๐ŸŒธ SYNOPSIS ๐ŸŒธ

time [option ...] command [argument ...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So here's the tea: time runs the program you named as command, with all those arguments you handed her. And the moment command finishes, she writes a little message to standard error with the timing stats for that run. Obsessed.

Those stats are literally three things:

  1. the elapsed real time between invocation and termination (like, wall-clock, the vibe of how long you sat there),
  2. the user CPU time โ€” which is the sum of the tms_utime and tms_cutime values in a struct tms as returned by times(2) โœจ
  3. the system CPU time โ€” the sum of the tms_stime and tms_cstime values in a struct tms as returned by times(2) ๐Ÿ’…
heads up bestie: some shells (looking at you, bash(1)) have a built-in time command that gives similar info about usage of time and possibly other resources too. so if you wanna reach the real command, you might need to specify its pathname, something like /usr/bin/time. don't get tricked by the impostor ๐Ÿซถ

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -p โ€” when you're in the POSIX locale, use the precise traditional format:
"real %f\nuser %f\nsys %f\n"

(with numbers in seconds) where the number of decimals in the output for %f is unspecified but is sufficient to express the clock tick accuracy, and at least one. like, at least one decimal, she said what she said.


๐Ÿ’œ EXIT STATUS ๐Ÿ’œ

  • If command was invoked, the exit status is that of command. simple, she's a mirror.
  • Otherwise it's 127 if command could not be found,
  • 126 if it could be found but could not be invoked,
  • and some other nonzero value (1โ€“125) if something else went wrong. ๐Ÿ˜ญ

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

The variables LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_NUMERIC, and NLSPATH are used for the text and formatting of the output. And PATH is used to search for command. yep, she's reading your env like a group chat screenshot.


๐Ÿ‘‘ GNU VERSION ๐Ÿ‘‘

Below is a description of the GNU 1.7 version of time. And get this โ€” disregarding the name of the utility, GNU makes it output lots of useful info, not only about time used, but also about other resources like memory, I/O and IPC calls (where available). she's doing the most and we love her for it. ๐Ÿ’…

The output is formatted using a format string that can be specified using the -f option or the TIME environment variable.

The default format string is:

%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps

When the -p option is given, the (portable) output format is used:

real %e
user %U
sys %S

๐Ÿ’ซ The format string ๐Ÿ’ซ

The format is interpreted in the usual printf(3)-like way. Ordinary characters are directly copied โ€” tab, newline, and backslash are escaped using \t, \n, and \\, a percent sign is represented by %%, and otherwise % indicates a conversion. And note: the program time will always add a trailing newline itself. periodt.

The conversions follow. All of those used by tcsh(1) are supported. ๐Ÿฉท

โฐ Time

  • %E โ€” Elapsed real time (in [hours:]minutes:seconds).
  • %e โ€” (Not in tcsh(1).) Elapsed real time (in seconds).
  • %S โ€” Total number of CPU-seconds that the process spent in kernel mode.
  • %U โ€” Total number of CPU-seconds that the process spent in user mode.
  • %P โ€” Percentage of the CPU that this job got, computed as (%U + %S) / %E.

๐Ÿง  Memory

  • %M โ€” Maximum resident set size of the process during its lifetime, in Kbytes.
  • %t โ€” (Not in tcsh(1).) Average resident set size of the process, in Kbytes.
  • %K โ€” Average total (data+stack+text) memory use of the process, in Kbytes.
  • %D โ€” Average size of the process's unshared data area, in Kbytes.
  • %p โ€” (Not in tcsh(1).) Average size of the process's unshared stack space, in Kbytes.
  • %X โ€” Average size of the process's shared text space, in Kbytes.
  • %Z โ€” (Not in tcsh(1).) System's page size, in bytes. This is a per-system constant, but varies between systems. so, iykyk.
  • %F โ€” Number of major page faults that occurred while the process was running. These are faults where the page has to be read in from disk.
  • %R โ€” Number of minor, or recoverable, page faults. These are faults for pages that are not valid but which have not yet been claimed by other virtual pages. Thus the data in the page is still valid but the system tables must be updated.
  • %W โ€” Number of times the process was swapped out of main memory.
  • %c โ€” Number of times the process was context-switched involuntarily (because the time slice expired).
  • %w โ€” Number of waits: times that the program was context-switched voluntarily, for instance while waiting for an I/O operation to complete.

๐Ÿ“ฅ I/O

  • %I โ€” Number of filesystem inputs by the process.
  • %O โ€” Number of filesystem outputs by the process.
  • %r โ€” Number of socket messages received by the process.
  • %s โ€” Number of socket messages sent by the process.
  • %k โ€” Number of signals delivered to the process.
  • %C โ€” (Not in tcsh(1).) Name and command-line arguments of the command being timed.
  • %x โ€” (Not in tcsh(1).) Exit status of the command.

๐ŸŒŸ GNU options ๐ŸŒŸ

  • -f format, --format=format โ€” Specify output format, possibly overriding the format specified in the environment variable TIME.
  • -p, --portability โ€” Use the portable output format.
  • -o file, --output=file โ€” Do not send the results to stderr, but overwrite the specified file.
  • -a, --append โ€” (Used together with -o.) Do not overwrite but append. she's adding to the pile, not replacing it ๐Ÿ’–
  • -v, --verbose โ€” Give very verbose output about all the program knows about. she's spilling everything.
  • -q, --quiet โ€” Don't report abnormal program termination (where command is terminated by a signal) or nonzero exit status. shhh ๐Ÿคซ

โญ GNU standard options โญ

  • --help โ€” Print a usage message on standard output and exit successfully.
  • -V, --version โ€” Print version information on standard output, then exit successfully.
  • -- โ€” Terminate option list. that's it, options are done, we're in argument territory now.

๐Ÿ’€ BUGS ๐Ÿ’€

Not all resources are measured by all versions of UNIX, so some of the values might be reported as zero. The present selection was mostly inspired by the data provided by 4.2 or 4.3BSD. ๐Ÿ˜ญ

GNU time version 1.7 is not yet localized. Thus, it does not implement the POSIX requirements. bestie is monolingual, so sorry.

The environment variable TIME was badly chosen. It is not unusual for systems like autoconf(1) or make(1) to use environment variables with the name of a utility to override the utility to be used. Uses like MORE or TIME for options to programs (instead of program pathnames) tend to lead to difficulties. like, whose idea was that. ๐Ÿ’€

It seems unfortunate that -o overwrites instead of appends. (That is, the -a option should be the default.) we said what we said!

Mail suggestions and bug reports for GNU time to bug-time@gnu.org. Please include the version of time, which you can get by running

time --version

and the operating system and C compiler you used. thank youuu ๐Ÿซถ


๐ŸŒธ SEE ALSO ๐ŸŒธ

bash(1), tcsh(1), times(2), wait3(2)


and that's the whole vibe check, bestie โœจ this page came to you courtesy of Linux man-pages 6.20, dated 2026-02-08, for time(1). go time something and slay ๐Ÿ’…๐ŸŽ€๐ŸŒˆ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-1.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms