<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://wiki.cabal.mx/index.php?action=history&amp;feed=atom&amp;title=Comandos_de_la_terminal%2Ftime</id>
	<title>Comandos de la terminal/time - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cabal.mx/index.php?action=history&amp;feed=atom&amp;title=Comandos_de_la_terminal%2Ftime"/>
	<link rel="alternate" type="text/html" href="https://wiki.cabal.mx/index.php?title=Comandos_de_la_terminal/time&amp;action=history"/>
	<updated>2026-04-05T05:15:35Z</updated>
	<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
	<generator>MediaWiki 1.32.1</generator>
	<entry>
		<id>https://wiki.cabal.mx/index.php?title=Comandos_de_la_terminal/time&amp;diff=5158&amp;oldid=prev</id>
		<title>Rrc en 21:50 13 ene 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.cabal.mx/index.php?title=Comandos_de_la_terminal/time&amp;diff=5158&amp;oldid=prev"/>
		<updated>2014-01-13T21:50:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
* [[:#time | time]]&lt;br /&gt;
&lt;br /&gt;
== time ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Measure the running time of a program.&lt;br /&gt;
&lt;br /&gt;
The `time&amp;#039; command will run another program, and record the elapsed time or CPU Resource Used time used by that program.&lt;br /&gt;
The information mmay be displayed on screen or saved in a file.&lt;br /&gt;
&lt;br /&gt;
Syntax&lt;br /&gt;
      time [option...] command [arg...]&lt;br /&gt;
&lt;br /&gt;
Options&lt;br /&gt;
&lt;br /&gt;
 -o FILE&lt;br /&gt;
 --output=FILE&lt;br /&gt;
     Write the resource use statistics to FILE.&lt;br /&gt;
&lt;br /&gt;
 -a&lt;br /&gt;
 --append&lt;br /&gt;
     *Append* the resource use information to the output file instead&lt;br /&gt;
     of overwriting it.&lt;br /&gt;
&lt;br /&gt;
 -f FORMAT&lt;br /&gt;
 --format=FORMAT&lt;br /&gt;
     Use FORMAT as the format string, see below for formatting options.&lt;br /&gt;
&lt;br /&gt;
 --help&lt;br /&gt;
     Summary of the command line options.&lt;br /&gt;
&lt;br /&gt;
 -o FILE&lt;br /&gt;
 --output=FILE&lt;br /&gt;
     Write the resource use statistics to FILE.  By default, this&lt;br /&gt;
     *overwrites* the file, destroying the file&amp;#039;s previous contents.&lt;br /&gt;
&lt;br /&gt;
 -a&lt;br /&gt;
 --append&lt;br /&gt;
     *Append* the resource use information to the output file instead&lt;br /&gt;
     of overwriting it.  This option is only useful with the `-o&amp;#039; or&lt;br /&gt;
     `--output&amp;#039; option.&lt;br /&gt;
&lt;br /&gt;
 -p&lt;br /&gt;
 --portability&lt;br /&gt;
     Use the POSIX format.&lt;br /&gt;
&lt;br /&gt;
 -v&lt;br /&gt;
 --verbose&lt;br /&gt;
     Use the built-in verbose format, which displays each available&lt;br /&gt;
     piece of information on the program&amp;#039;s resource use on its own&lt;br /&gt;
     line, with an English description of its meaning.&lt;br /&gt;
&lt;br /&gt;
-V&lt;br /&gt;
--version&lt;br /&gt;
     Print the version number of `time&amp;#039; and exit.&lt;br /&gt;
&lt;br /&gt;
Options to `time&amp;#039; must appear on the command line before COMMAND.&lt;br /&gt;
Anything on the command line after COMMAND is passed as arguments to&lt;br /&gt;
COMMAND.&lt;br /&gt;
&lt;br /&gt;
Setting the Output Format&lt;br /&gt;
`time&amp;#039; uses a &amp;quot;format string&amp;quot; to determine which information to display about the resources used by the command it runs. You can specify a format string with the options listed above.&lt;br /&gt;
If no format is specified on the command line, but the `TIME&amp;#039; environment variable is set, its value is used as the format string. Otherwise, the default format built into `time&amp;#039; is used:&lt;br /&gt;
&lt;br /&gt;
   %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k &lt;br /&gt;
   %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps&lt;br /&gt;
&lt;br /&gt;
The Format String&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;format string&amp;quot; controls the contents of the `time&amp;#039; output. It consists of &amp;quot;resource specifiers&amp;quot; and &amp;quot;escapes&amp;quot;, interspersed with&lt;br /&gt;
plain text.&lt;br /&gt;
&lt;br /&gt;
A backslash introduces an &amp;quot;escape&amp;quot;, which is translated into a single printing character upon output. The valid escapes are listed&lt;br /&gt;
below. An invalid escape is output as a question mark followed by a backslash.&lt;br /&gt;
&lt;br /&gt;
 \t     a tab character&lt;br /&gt;
 \n     a newline&lt;br /&gt;
 \\     a literal backslash&lt;br /&gt;
&lt;br /&gt;
`time&amp;#039; always prints a newline after printing the resource use information, so normally format strings do not end with a newline&lt;br /&gt;
character (or `\n&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
A resource specifier consists of a percent sign followed by another character. An invalid resource specifier is output as a question mark&lt;br /&gt;
followed by the invalid character. Use `%%&amp;#039; to output a literal percent sign.&lt;br /&gt;
&lt;br /&gt;
Time Resources&lt;br /&gt;
&lt;br /&gt;
 %E   Elapsed real (wall clock) time used by the process, in [hours:]minutes:seconds.&lt;br /&gt;
&lt;br /&gt;
 %e   Elapsed real (wall clock) time used by the process, in seconds.&lt;br /&gt;
&lt;br /&gt;
 %S   Total number of CPU-seconds used by the system on behalf of the&lt;br /&gt;
      process (in kernel mode), in seconds.&lt;br /&gt;
&lt;br /&gt;
 %U   Total number of CPU-seconds that the process used directly (in user&lt;br /&gt;
      mode), in seconds.&lt;br /&gt;
&lt;br /&gt;
 %P   Percentage of the CPU that this job got.  This is just user +&lt;br /&gt;
      system times divied by the total running time.&lt;br /&gt;
&lt;br /&gt;
Memory Resources&lt;br /&gt;
&lt;br /&gt;
 %M   Maximum resident set size of the process during its lifetime, in&lt;br /&gt;
      Kilobytes.&lt;br /&gt;
&lt;br /&gt;
 %t   Average resident set size of the process, in Kilobytes.&lt;br /&gt;
&lt;br /&gt;
 %K   Average total (data+stack+text) memory use of the process, in&lt;br /&gt;
      Kilobytes.&lt;br /&gt;
&lt;br /&gt;
 %D   Average size of the process&amp;#039;s unshared data area, in Kilobytes.&lt;br /&gt;
&lt;br /&gt;
 %p   Average size of the process&amp;#039;s unshared stack, in Kilobytes.&lt;br /&gt;
&lt;br /&gt;
 %X   Average size of the process&amp;#039;s shared text, in Kilobytes.&lt;br /&gt;
&lt;br /&gt;
 %Z   System&amp;#039;s page size, in bytes.  This is a per-system constant, but&lt;br /&gt;
       varies between systems.&lt;br /&gt;
&lt;br /&gt;
I/O Resources&lt;br /&gt;
&lt;br /&gt;
 %F   Number of major, or I/O-requiring, page faults that occurred while&lt;br /&gt;
      the process was running.  These are faults where the page has&lt;br /&gt;
      actually migrated out of primary memory.&lt;br /&gt;
&lt;br /&gt;
 %R   Number of minor, or recoverable, page faults.  These are pages&lt;br /&gt;
      that are not valid (so they fault) but which have not yet been&lt;br /&gt;
      claimed by other virtual pages.  Thus the data in the page is&lt;br /&gt;
      still valid but the system tables must be updated.&lt;br /&gt;
&lt;br /&gt;
 %W   Number of times the process was swapped out of main memory.&lt;br /&gt;
&lt;br /&gt;
 %c   Number of times the process was context-switched involuntarily&lt;br /&gt;
      (because the time slice expired).&lt;br /&gt;
&lt;br /&gt;
 %w   Number of times that the program was context-switched voluntarily,&lt;br /&gt;
      for instance while waiting for an I/O operation to complete.&lt;br /&gt;
&lt;br /&gt;
 %I   Number of file system inputs by the process.&lt;br /&gt;
&lt;br /&gt;
 %O   Number of file system outputs by the process.&lt;br /&gt;
&lt;br /&gt;
 %r   Number of socket messages received by the process.&lt;br /&gt;
&lt;br /&gt;
 %s   Number of socket messages sent by the process.&lt;br /&gt;
&lt;br /&gt;
 %k   Number of signals delivered to the process.&lt;br /&gt;
&lt;br /&gt;
Command Info&lt;br /&gt;
&lt;br /&gt;
 %C   Name and command line arguments of the command being timed.&lt;br /&gt;
&lt;br /&gt;
 %x   Exit status of the command.&lt;br /&gt;
&lt;br /&gt;
[rrc@Llawyr ~]$ alias time=/usr/bin/time&lt;br /&gt;
&lt;br /&gt;
[rrc@Llawyr ~]$ cd ComandosDeLaTerminal/&lt;br /&gt;
&lt;br /&gt;
[rrc@Llawyr ComandosDeLaTerminal]$ time wc /etc/hosts&lt;br /&gt;
 10  29 400 /etc/hosts&lt;br /&gt;
0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 3200maxresident)k&lt;br /&gt;
0inputs+0outputs (0major+249minor)pagefaults 0swaps&lt;br /&gt;
&lt;br /&gt;
[rrc@Llawyr ComandosDeLaTerminal]$ time -f &amp;quot;\t%E real,\t%U user,\t%S sys&amp;quot; ls -Fs&lt;br /&gt;
total 96&lt;br /&gt;
0 Archivo1DeTres  4 CatArchivo3  4 MiArchivo.Err  4 SortSi&lt;br /&gt;
0 Archivo2DeTres  4 cdcommand	 0 OutTxt	  0 STDERRArchivo&lt;br /&gt;
0 Archivo3DeTres  4 CosaFile	 4 Paginas/	  4 STRERR&lt;br /&gt;
0 ArchivodeTres   4 CutEjemplo	 4 RedirTxt	  0 TouchArchivo&lt;br /&gt;
0 ArchivoDeTres   4 DirFile	 4 Res2		  4 typescript&lt;br /&gt;
0 ArD		  4 Err3	 4 Resulto	  4 UniqEjemplo&lt;br /&gt;
0 ArDeTres	  4 LSComando*	 4 ScriptFile	  4 UniqSortEjemplo&lt;br /&gt;
4 CatArchivo	  0 LSList	 4 SortEjemplo	  4 WCEjemplo&lt;br /&gt;
4 CatArchivo2	  4 MiArchivo	 4 SortFile&lt;br /&gt;
	0:00.00 real,	0.00 user,	0.00 sys&lt;br /&gt;
[rrc@Llawyr ComandosDeLaTerminal]$  time cat&lt;br /&gt;
Puedes terminar con ^d&lt;br /&gt;
Puedes terminar con ^d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0.00user 0.00system 0:14.26elapsed 0%CPU (0avgtext+0avgdata 2736maxresident)k&lt;br /&gt;
0inputs+0outputs (0major+220minor)pagefaults 0swaps&lt;br /&gt;
&lt;br /&gt;
[rrc@Llawyr ComandosDeLaTerminal]$ time -V&lt;br /&gt;
GNU time 1.7&lt;br /&gt;
&lt;br /&gt;
[rrc@Llawyr ComandosDeLaTerminal]$ time --help&lt;br /&gt;
Usage: /usr/bin/time [-apvV] [-f format] [-o file] [--append] [--verbose]&lt;br /&gt;
       [--portability] [--format=format] [--output=file] [--version]&lt;br /&gt;
       [--quiet] [--help] command [arg...]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Comandos de la terminal]]&lt;/div&gt;</summary>
		<author><name>Rrc</name></author>
		
	</entry>
</feed>