ts utility prepends a timestamp to
each line of standard input and writes it to standard output.
The options are as follows:
- Display time elapsed since the last timestamp.
- Display timestamps derived from a strictly linearly increasing clock.
-m, timestamps reflect the current date and time, including time jumps if the system time is changed.
- Display time elapsed since the start of the program.
The optional format argument controls how
the timestamp is displayed, according to the conversion specifications
described in the strftime(3) manual page. The default format is "%b %d
%H:%M:%S"; or "%H:%M:%S" if one of the
-s options is
Some additional conversion specifications are also supported to
append microsecond resolution:
%.T; which are
%T. Examples: "10.00001",
"1656427781.00001", and "4:20:00.00001".
$ (echo foo; sleep 2; echo bar) | ts Jun 28 12:13:38 foo Jun 28 12:13:40 bar $ ls | ts -i %.S 00.000452 CVS 00.000595 Makefile 00.000004 ts.1 00.000004 ts.c
ts utility first appeared in the
moreutils collection by Joey Hess, and was rewritten from scratch for
ts utility was written by
Claudio Jeker <firstname.lastname@example.org>.