ETS(1)

πŸ“¦ version 0.3.3, in nixos 26.05, nixpkgs unstable

πŸ’– ETS(1) β€” command output timestamper πŸ’–

okay so bestie, let me tell you about ets. the manual page calls it a "command output timestamper," which is honestly the most boring way to say "it puts a little timestamp on every line of output so you finally know when things happened." she's giving timekeeper energy and we're obsessed. πŸ•βœ¨


✨ SYNOPSIS ✨

ets [-s | -i] [-f format] [-u | -z timezone] [-d delimiter] command
    [arg ...]
ets [options] shell_command
ets [options]

🌸 DESCRIPTION 🌸

ets prefixes each line of a command's output with a timestamp. lines are delimited by CR, LF, or CRLF. periodt. πŸ’…

the three forms up in SYNOPSIS are literally three different ways she can run your command:

  • if you give her a single command without whitespace(s), or a command and its arguments, she executes the command with exec in a pty 🫢
  • if you give her a single command with whitespace(s), the command is treated as a shell command and executed as SHELL -c shell_command, where SHELL is the current user's login shell, or sh if login shell cannot be determined
  • if you give her no command at all, output is read from stdin, and the user is responsible for piping in a command's output. you're the main character here, ngl πŸ’€

πŸŽ€ the three timestamp modes (mutually exclusive, pick one bestie) πŸŽ€

  • the default is absolute time mode, where timestamps from the wall clock are shown πŸ•°οΈ
  • -s, --elapsed turns on elapsed time mode, where every timestamp is the time elapsed from the start of the command (using a monotonic clock)
  • -i, --incremental turns on incremental time mode, where every timestamp is the time elapsed since the last timestamp (using a monotonic clock)

the default format of the prefixed timestamps depends on the timestamp mode active. users may supply a custom format string with the -f, --format option. ✨

the timezone for absolute timestamps can be controlled via the -u, --utc and -z, --timezone options. local time is used by default.


πŸ‘‘ OPTIONS πŸ‘‘

here's the full list, no skipping, we don't do that here πŸ’œ

  • -s, --elapsed β€” run in elapsed time mode.
  • -i, --incremental β€” run in incremental time mode.
  • -f, --format format β€” use custom strftime(3)-style format string format for prefixed timestamps. the default is [%Y-%m-%d %H:%M:%S] for absolute time mode and [%H:%M:%S] for elapsed and incremental time modes. see "FORMATTING DIRECTIVES" for details. πŸŽ€
  • -u, --utc β€” use UTC for absolute timestamps instead of local time.
this option is mutually exclusive with --z, --timezone. pick a lane bestie 😭
  • -z, --timezone timezone β€” use timezone for absolute timestamps instead of local time. timezone is an IANA time zone name, e.g. America/Los_Angeles.
this option is mutually exclusive with -u, --utc. same rule, other direction πŸ’€
  • -c, --color β€” print timestamps in color. aesthetically iconic, no notes 🌈
  • -d, --delimit β€” change the delimiter between the timestamp and the command output. the default is space.

πŸ¦‹ FORMATTING DIRECTIVES πŸ¦‹

formatting directives largely match strftime(3)'s directives on FreeBSD and macOS, with the following differences:

  • additional directives %f for microsecond and %L for millisecond are supported. πŸ”₯
  • POSIX locale extensions %E* and %O* are not supported
  • glibc extensions %-*, %_*, and %0* are not supported
  • directives %G, %g, and %+ are not supported

below is the full list of supported directives β€” yes, all of them, we're going the whole way down the list together bestie 🫢

  • %A β€” is replaced by national representation of the full weekday name.
  • %a β€” is replaced by national representation of the abbreviated weekday name.
  • %B β€” is replaced by national representation of the full month name.
  • %b β€” is replaced by national representation of the abbreviated month name.
  • %C β€” is replaced by (year / 100) as decimal number; single digits are preceded by a zero.
  • %c β€” is replaced by national representation of time and date.
  • %D β€” is equivalent to %m/%d/%y.
  • %d β€” is replaced by the day of the month as a decimal number (01-31).
  • %e β€” is replaced by the day of the month as a decimal number (1-31); single digits are preceded by a blank.
  • %F β€” is equivalent to %Y-%m-%d.
  • %f β€” is replaced by the microsecond as a decimal number (000000-999999).
  • %H β€” is replaced by the hour (24-hour clock) as a decimal number (00-23).
  • %h β€” the same as %b.
  • %I β€” is replaced by the hour (12-hour clock) as a decimal number (01-12).
  • %j β€” is replaced by the day of the year as a decimal number (001-366).
  • %k β€” is replaced by the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank.
  • %L β€” is replaced by the millisecond as a decimal number (000-999).
  • %l β€” is replaced by the hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank.
  • %M β€” is replaced by the minute as a decimal number (00-59).
  • %m β€” is replaced by the month as a decimal number (01-12).
  • %n β€” is replaced by a newline.
  • %p β€” is replaced by national representation of either "ante meridiem" (a.m.) or "post meridiem" (p.m.) as appropriate.
  • %R β€” is equivalent to %H:%M.
  • %r β€” is equivalent to %I:%M:%S %p.
  • %S β€” is replaced by the second as a decimal number (00-60).
  • %s β€” is replaced by the number of seconds since the Epoch, UTC (see mktime(3)).
  • %T β€” is equivalent to %H:%M:%S.
  • %t β€” is replaced by a tab.
  • %U β€” is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number (00-53).
  • %u β€” is replaced by the weekday (Monday as the first day of the week) as a decimal number (1-7).
  • %V β€” is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (01-53). if the week containing January 1 has four or more days in the new year, then it is week 1; otherwise it is the last week of the previous year, and the next week is week 1.
  • %v β€” is equivalent to %e-%b-%Y.
  • %W β€” is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (00-53).
  • %w β€” is replaced by the weekday (Sunday as the first day of the week) as a decimal number (0-6).
  • %X β€” is replaced by national representation of the time.
  • %x β€” is replaced by national representation of the date.
  • %Y β€” is replaced by the year with century as a decimal number.
  • %y β€” is replaced by the year without century as a decimal number (00-99).
  • %Z β€” is replaced by the time zone name.
  • %z β€” is replaced by the time zone offset from UTC; a leading plus sign stands for east of UTC, a minus sign for west of UTC, hours and minutes follow with two digits each and no delimiter between them (common form for RFC 822 date headers).
  • %% β€” is replaced by %.

🧚 SEE ALSO 🧚

ts(1), strftime(3) β€” go read those too, they're the extended universe iykyk πŸ“šπŸ’«


⭐ HISTORY ⭐

the name ets comes from "enhanced ts", referring to moreutils ts(1). a little glow-up origin story, we love to see it πŸ’–


🌸 AUTHORS 🌸

Zhiming Wang <i@zhimingwang.org> and Contributors β€” legends, honestly. thank them for the timestamps πŸ™βœ¨


bestie that's the whole page, every flag, every directive, nothing skipped. now go timestamp something and slay βœ¨πŸ’…

this page is from March 2, 2025, and it's the ETS(1) manual β€” mwah, drink water, and pipe your output responsibly πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from