<div dir="ltr">sed is your friend<div>Something like:</div><div><i>sed "s/Jan/01/;s/Feb/02/"</i><br clear="all"><div><div dir="rtl" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="rtl"><div dir="rtl"><br></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 17 Jan 2022 at 10:58, אורי <<a href="mailto:uri@speedy.net">uri@speedy.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I want to check mail.log for how many emails are sent every day. The format of my mail.log is something like this:</div><div><br></div><div>Jan 17 08:49:23 www .... (the rest of the log)</div><div><br></div><div>I'm running a command such as:</div><div><br></div><div>cat mail.log* |fgrep "status=sent (250 Ok"|awk '{print $1" "$2}'|sort -n|uniq -c</div><div><br></div><div>And I receive the number of emails sent every day. But the date doesn't contain the year, the months are sorted alphabetically and the line of Jan 17 comes before the line of Jan 2. I would like to sort the lines according to the date order such as in yyyy-mm-dd and with including the year. How do I do it?</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="direction:rtl"><div style="direction:rtl">אורי</div><div style="direction:rtl"><a href="mailto:uri@speedy.net" target="_blank">uri@speedy.net</a></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</blockquote></div>