Tips & Tricks How to grep by date range 7 July 2012 jonas 1 Comment Have you ever wonder how to grep a file within a date range? cat file.log | sed -n '/2012-01-05 16:55/,/2012-01-05 18:30/p' > file.log.date_range
You’ll get unexpected output if the ending date “2012-01-05 18:30” isn’t in the file.log file.