1TS(1) TS(1)
2
3
4
6 ts - timestamp input
7
9 ts [-r] [-i | -s] [format]
10
12 ts adds a timestamp to the beginning of each line of input.
13
14 The optional format parameter controls how the timestamp is formatted,
15 as used by strftime(3). The default format is "%b %d %H:%M:%S". In
16 addition to the regular strftime conversion specifications, "%.S" and
17 "%.s" are like "%S" and "%s", but provide subsecond resolution (ie,
18 "30.00001" and "1301682593.00001").
19
20 If the -r switch is passed, it instead converts existing timestamps in
21 the input to relative times, such as "15m5s ago". Many common timestamp
22 formats are supported. Note that the Time::Duration and Date::Parse
23 perl modules are required for this mode to work. Currently, converting
24 localized dates is not supported.
25
26 If both -r and a format is passed, the existing timestamps are
27 converted to the specified format.
28
29 If the -i or -s switch is passed, ts timestamps incrementally instead.
30 In case of -i, every timestamp will be the time elapsed since the last
31 timestamp. In case of -s, the time elapsed since start of the program
32 is used. The default format changes to "%H:%M:%S", and "%.S" and "%.s"
33 can be used as well.
34
36 The standard TZ environment variable controls what time zone dates are
37 assumed to be in, if a timezone is not specified as part of the date.
38
40 Copyright 2006 by Joey Hess <id@joeyh.name>
41
42 Licensed under the GNU GPL.
43
44
45
46moreutils 2015-07-13 TS(1)