TS(1)

๐Ÿ’– TS(1) ๐Ÿ’–

okay bestie, buckle up, because ts from the moreutils crew is here and she is so much more useful than her tiny name makes her sound ๐Ÿซถ


โœจ NAME โœจ

ts โ€” she timestamps your input, that's the whole job, and she eats every time ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

ts adds a timestamp to the beginning of each line of input. That's it. That's the whole vibe. Your boring stream of lines becomes a little diary with receipts. ๐Ÿ““โœจ

The optional format parameter controls how the timestamp is formatted, exactly as used by strftime(3). The default format is "%b %d %H:%M:%S" โ€” iconic, timeless, no notes.

Now here's the spicy part ๐Ÿ”ฅ: besides all the regular strftime conversion specifications, ts also gives you "%.S", "%.s" and "%.T". These are like "%S", "%s" and "%T" but with subsecond resolution, iykyk. So instead of a boring whole second you get stuff like "30.00001" and "1301682593.00001" and "1:15:30.00001". Tiny little crumbs of precision ๐Ÿ’€โœจ

If the -r switch is passed, she switches gears entirely: instead of adding timestamps, she converts existing timestamps in the input to relative times, like "15m5s ago". So relatable, honestly โ€” everything is "ago" if you think about it ๐Ÿ˜ญ. Lots of common timestamp formats are supported, ngl she's flexible like that.

โš ๏ธ bestie, heads up: the Time::Duration and Date::Parse perl modules are required for this mode to work. If you don't have them, this mode is just not happening. Also โ€” currently, converting localized dates is not supported. Periodt.

If both -r and a format is passed, then the existing timestamps get converted to the specified format instead. Two modes, one slay ๐ŸŒˆ

If the -i or -s switch is passed, ts reports incremental timestamps instead of absolute ones. The default format changes to "%H:%M:%S" when you do this (not the usual default, kmow the difference bestie), and "%.S" and "%.s" can be used as well.

  • in case of -i, every timestamp will be the time elapsed since the last timestamp โ€” so it's like, what changed since last time? deltas, gaps, the drama between lines ๐Ÿ’…
  • in case of -s, the time elapsed since start of the program is used โ€” so it's a running stopwatch from the moment she woke up โฑ๏ธ

The -m switch makes the system's monotonic clock be used. Main character energy: she does not care what the wall clock thinks, she only moves forward. ๐Ÿ‘‘


๐ŸŒฟ ENVIRONMENT ๐ŸŒฟ

  • TZ โ€” 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. Basically: if the date doesn't say where it's from, TZ gets to decide its whole personality. ๐Ÿ•ฐ๏ธ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Copyright 2006 by Joey Hess <id@joeyh.name> ๐ŸŽ€

Licensed under the GNU GPL.


and that's the whole page, bestie ๐Ÿ’– this is TS(1) from moreutils, dated 2026-04-16 โ€” go timestamp something and make it everyone's problem. no cap. ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from