OpenBSD manual page server

Manual Page Search Parameters

TS(1) General Commands Manual TS(1)

tstimestamp input

ts [-i | -s] [-m] [format]

The 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. Without -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 -i or -s options is used.

Some additional conversion specifications are also supported to append microsecond resolution: %.S, %.s, and %.T; which are similar to %S, %s, and %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


A ts utility first appeared in the moreutils collection by Joey Hess, and was rewritten from scratch for OpenBSD 7.2.

This ts utility was written by Job Snijders <> and
Claudio Jeker <>.

July 3, 2022 OpenBSD-current