Annotation of src/usr.bin/ts/ts.1, Revision 1.3
1.3 ! job 1: .\" $OpenBSD: ts.1,v 1.2 2022/06/29 16:01:10 job Exp $
1.1 job 2: .\"
3: .\" Copyright (c) 2022 Job Snijders <job@openbsd.org>
4: .\"
5: .\" Permission to use, copy, modify, and distribute this software for any
6: .\" purpose with or without fee is hereby granted, provided that the above
7: .\" copyright notice and this permission notice appear in all copies.
8: .\"
9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16: .\"
1.2 job 17: .Dd $Mdocdate: June 29 2022 $
1.1 job 18: .Dt TS 1
19: .Os
20: .Sh NAME
21: .Nm ts
22: .Nd timestamp input
23: .Sh SYNOPSIS
24: .Nm ts
25: .Op Fl i | s
1.2 job 26: .Op Fl m
1.1 job 27: .Op Ar format
28: .Sh DESCRIPTION
29: When invoked, the
30: .Nm
31: utility adds a timestamp to the beginning of each line of input.
32: .Pp
33: The options are as follows:
34: .Bl -tag -width Ds
35: .It Fl i
36: Display time elapsed since the last timestamp.
1.2 job 37: .It Fl m
38: Display timestamps derived from a strictly linearly increasing clock.
39: Without
40: .Fl m ,
41: timestamps reflect the current date and time, including time jumps if the
42: system time is changed.
1.1 job 43: .It Fl s
44: Display time elapsed since the start of the program.
45: .El
46: .Pp
47: The optional
48: .Ar format
49: argument controls how the timestamp is displayed, according to the conversion
50: specifications described in the
51: .Xr strftime 3
52: manual page.
53: The default format is
1.3 ! job 54: .Qq %b %d %H:%M:%S ;
1.1 job 55: or
56: .Qq %H:%M:%S
1.3 ! job 57: if one of the
! 58: .Fl i
! 59: or
! 60: .Fl s
! 61: options is used.
1.1 job 62: .Pp
63: The following non-standard conversion specifications append microsecond
64: resolution:
65: .Cm \&%.S ,
66: .Cm \&%.s ,
67: and
68: .Cm \&%.T ;
69: which are similar to
70: .Cm \&%S ,
71: .Cm \&%s ,
72: and
73: .Cm \&%T .
74: Examples:
75: .Qq 10.00001 ,
76: .Qq 1656427781.00001 ,
77: and
78: .Qq 4:20:00.00001 .
79: .Sh EXAMPLES
80: .Bd -literal -offset indent
81: $ (echo foo; sleep 2; echo bar) | ts
82: Jun 28 12:13:38 foo
83: Jun 28 12:13:40 bar
84:
85: $ ls | ts -i %.S
86: 00.000452 CVS
87: 00.000595 Makefile
88: 00.000004 ts.1
89: 00.000004 ts.c
90: .Ed
91: .Sh HISTORY
92: A
93: .Nm
94: utility first appeared in the moreutils collection by Joey Hess, and was
95: rewritten from scratch for
96: .Ox 7.2 .
97: .Sh AUTHORS
98: This
99: .Nm
100: utility was written by
101: .An Job Snijders Aq Mt job@openbsd.org
102: and
103: .An Claudio Jeker Aq Mt claudio@openbsd.org .