Annotation of src/usr.bin/ts/ts.1, Revision 1.7
1.7 ! job 1: .\" $OpenBSD: ts.1,v 1.6 2022/06/30 21:40:41 jmc 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.6 jmc 17: .Dd $Mdocdate: June 30 2022 $
1.1 job 18: .Dt TS 1
19: .Os
20: .Sh NAME
1.5 kn 21: .Nm ts
1.1 job 22: .Nd timestamp input
23: .Sh SYNOPSIS
1.7 ! job 24: .Nm
1.1 job 25: .Op Fl i | s
1.2 job 26: .Op Fl m
1.1 job 27: .Op Ar format
28: .Sh DESCRIPTION
1.4 job 29: The
1.1 job 30: .Nm
1.4 job 31: utility prepends a timestamp to each line of standard input and writes
32: it to standard output.
1.1 job 33: .Pp
34: The options are as follows:
35: .Bl -tag -width Ds
36: .It Fl i
37: Display time elapsed since the last timestamp.
1.2 job 38: .It Fl m
39: Display timestamps derived from a strictly linearly increasing clock.
40: Without
41: .Fl m ,
42: timestamps reflect the current date and time, including time jumps if the
43: system time is changed.
1.1 job 44: .It Fl s
45: Display time elapsed since the start of the program.
46: .El
47: .Pp
48: The optional
49: .Ar format
50: argument controls how the timestamp is displayed, according to the conversion
51: specifications described in the
52: .Xr strftime 3
53: manual page.
54: The default format is
1.3 job 55: .Qq %b %d %H:%M:%S ;
1.1 job 56: or
57: .Qq %H:%M:%S
1.3 job 58: if one of the
59: .Fl i
60: or
61: .Fl s
62: options is used.
1.1 job 63: .Pp
1.6 jmc 64: Some additional conversion specifications are also supported
65: to append microsecond resolution:
66: .Cm %.S ,
67: .Cm %.s ,
1.1 job 68: and
1.6 jmc 69: .Cm %.T ;
1.1 job 70: which are similar to
1.6 jmc 71: .Cm %S ,
72: .Cm %s ,
1.1 job 73: and
74: .Cm \&%T .
75: Examples:
76: .Qq 10.00001 ,
77: .Qq 1656427781.00001 ,
78: and
79: .Qq 4:20:00.00001 .
80: .Sh EXAMPLES
81: .Bd -literal -offset indent
1.5 kn 82: $ (echo foo; sleep 2; echo bar) | ts
1.1 job 83: Jun 28 12:13:38 foo
84: Jun 28 12:13:40 bar
85:
86: $ ls | ts -i %.S
87: 00.000452 CVS
88: 00.000595 Makefile
89: 00.000004 ts.1
90: 00.000004 ts.c
91: .Ed
1.6 jmc 92: .Sh SEE ALSO
93: .Xr strftime 3
1.1 job 94: .Sh HISTORY
95: A
96: .Nm
97: utility first appeared in the moreutils collection by Joey Hess, and was
98: rewritten from scratch for
99: .Ox 7.2 .
100: .Sh AUTHORS
101: This
102: .Nm
103: utility was written by
104: .An Job Snijders Aq Mt job@openbsd.org
105: and
106: .An Claudio Jeker Aq Mt claudio@openbsd.org .