TS(1)

πŸ“¦ version 0.70, in alpine 3.24

πŸ’… 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