Forrest logo
back to the ${command} tool

ts:tldr:8e614

ts: Add timestamps with microsecond precision.
$ ${command} | ts "${%b %d %H:%M:%-S}"
try on your machine

This command is a combination of two parts, the ${command} part and the ts "${%b %d %H:%M:%-S}" part, separated by the pipe (|) symbol.

The ${command} part represents a placeholder for an actual command that will be executed. It could be any valid command or a script. The output of this command will be used as the input for the next part of the command.

The ts "${%b %d %H:%M:%-S}" part is a command that adds a timestamp to each line of the input it receives. The ts command stands for timestamp and is commonly used to prepend timestamps to data. In this case, the timestamp format is specified as ${%b %d %H:%M:%-S}.

Let's break down the timestamp format:

  • %b represents the abbreviated month name (e.g., Jan, Feb, Mar).
  • %d represents the day of the month as a zero-padded decimal number (e.g., 01, 02, 03).
  • %H represents the hour (24-hour clock) as a zero-padded decimal number (e.g., 00, 01, 02).
  • %M represents the minute as a zero-padded decimal number (e.g., 00, 01, 02).
  • %-S represents the second as a decimal number without leading zeros (e.g., 0, 1, 2).

Therefore, the ts command will take the output of ${command} and prepend each line with a timestamp in the format specified.

Overall, this command executes ${command} and adds a timestamp to each line of the command's output.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ${command} tool