Skip to content
Advertisement

want to sort my log file on this timestamp 2019-06-29T12:39:23.428Z using sort command but confused as there are multiple delimeter

This is the format of timestamp on which 2019-06-29T12:39:23.428Z I want to sort. But the year is delimited by - and the time is delimited by : and both year and time are separated my T'.

JavaScript

Tried this.

Advertisement

Answer

You can manually pick out each field to sort with -k

from man:

JavaScript

So something like this should sort your output:

JavaScript

However: a simple sort should solve your issue.

JavaScript
Advertisement