TS(1)
π
TS(1) β the ts manual, section 1, bestie edition β¨
okay so welcome to the ts(1) page, part of moreutils, and honestly? she's a little icon. let's get into it π
β¨ NAME β¨
ts β timestamp input. that's it, that's the whole vibe. she timestamps your input π«Ά
πΈ SYNOPSIS πΈ
ts [-r] [-i | -s] [-m] [format]
π¦ DESCRIPTION π¦
ts adds a timestamp to the beginning of every single line of input. literally every line. no line left behind π
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". and here's the fun part β on top of the regular strftime conversion specifications, you also get "%.S" and "%.s" and "%.T", which are like "%S" and "%s" and "%T" but with subsecond resolution. so you get stuff like "30.00001" and "1301682593.00001" and "1:15:30.00001". obsessed with the precision ngl β±οΈβ¨
If the -r switch is passed, she flips the whole thing: instead of adding timestamps, she converts the existing timestamps in the input to relative times, like "15m5s ago". many common timestamp formats are supported. but β and this is the important bit β the Time::Duration and Date::Parse perl modules are required for this mode to work. no cap, if you don't have them it's not happening π Also, currently, converting localized dates is not supported.
If both -r and a format are passed, the existing timestamps get converted to the specified format instead. cute, right? π
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. so:
- with
-i, every timestamp is the time elapsed since the last timestamp. - with
-s, it's the time elapsed since the start of the program.
pick your fighter, both slay π
The -m switch makes the system's monotonic clock be used. she's on a different clock now, main character energy β
π§ 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. so if your dates are looking at you funny, check your TZ first π
π AUTHOR π
Copyright 2006 by Joey Hess <id@joeyh.name>
Licensed under the GNU GPL.
and that's the page!! π
fr fr, remember: -r needs those perl modules, and localized dates aren't supported in that mode. don't come for me, I'm just the messenger π
moreutils Β· 2025-06-30 Β· that's the version and date bestie, mwah ππ
π¦ where this page comes from
- alpine 3.24: moreutils-doc 0.70-r1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms