Linux/ts

From Omnia
Revision as of 19:07, 3 August 2024 by Kenneth (talk | contribs)
Jump to navigation Jump to search

ts

ts adds a timestamp to the beginning of each line of input
The optional format parameter controls how the timestamp is formatted, as used by strftime(3)
The default format is "%b %d %H:%M:%S"
ts 
    # no parameter default  (eg. Aug 03 12:06:32)
-r  # relative time ago (eg. 15m5s ago)
-i  # incremental time since last log  (eg. 00:00:00)
-s  # time since program start  (eg "00:00:00")
-m  # monotonic clock  (eg. Aug 03 12:06:32) 

Timestamp Output

tail -f /some/device_or_log | ts -s