I have a log file like this:
my test log line May 18 2024 13:30
my test log line May 19 2024 13:30
my test log line May 21 2024 13:30
my test log line May 22 2024 13:30
my test log line May 23 2024 13:30
my test log line May 24 2024 13:30
my test log line May 25 2024 13:30
my test log line May 26 2024 13:30
my test log line May 27 2024 13:30
my test log line May 28 2024 13:30
my test log line May 29 2024 13:30
The format like $(date '+%B %d %Y %H:%M:%S')
and always is as above.
How can I extract the the last N days, let's say last 7 days for example?
Expected output could be like this:
my test log line May 22 2024 13:30
my test log line May 23 2024 13:30
my test log line May 24 2024 13:30
my test log line May 25 2024 13:30
my test log line May 26 2024 13:30
my test log line May 27 2024 13:30
my test log line May 28 2024 13:30
my test log line May 29 2024 13:30
Or it May 21
could be included too.
I googled but could found nothing.