.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "TS 1" .TH TS 1 2024-02-25 moreutils " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME ts \- timestamp input .SH SYNOPSIS .IX Header "SYNOPSIS" ts [\-r] [\-i | \-s] [\-m] [format] .SH DESCRIPTION .IX Header "DESCRIPTION" ts adds a timestamp to the beginning of each line of input. .PP The optional format parameter controls how the timestamp is formatted, as used by \fBstrftime\fR\|(3). The default format is "%b \f(CW%d\fR \f(CW%H:\fR%M:%S". In addition to the regular strftime conversion specifications, "%.S" and "%.s" and "%.T" are like "%S" and "%s" and "%T", but provide subsecond resolution (ie, "30.00001" and "1301682593.00001" and "1:15:30.00001"). .PP If the \-r switch is passed, it instead converts existing timestamps in the input to relative times, such as "15m5s ago". Many common timestamp formats are supported. Note that the Time::Duration and Date::Parse perl modules are required for this mode to work. Currently, converting localized dates is not supported. .PP If both \-r and a format is passed, the existing timestamps are converted to the specified format. .PP If the \-i or \-s switch is passed, ts reports incremental timestamps instead of absolute ones. The default format changes to "%H:%M:%S", and "%.S" and "%.s" can be used as well. In case of \-i, every timestamp will be the time elapsed since the last timestamp. In case of \-s, the time elapsed since start of the program is used. .PP The \-m switch makes the system's monotonic clock be used. .SH ENVIRONMENT .IX Header "ENVIRONMENT" The standard TZ environment variable controls what time zone dates are assumed to be in, if a timezone is not specified as part of the date. .SH AUTHOR .IX Header "AUTHOR" Copyright 2006 by Joey Hess .PP Licensed under the GNU GPL.