Sort logs by date field in bash

For GNU sort: sort -k2M -k3n -k4

  • -k2M sorts by second column by month (this way “March” comes before “April”)
  • -k3n sorts by third column in numeric mode (so that ” 9″ comes before “10”)
  • -k4 sorts by the fourth column.

See more details in the manual.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)