Have you ever wonder how to grep a file within a date range?
[codesyntax lang="bash"]
cat file.log | sed -n '/2012-01-05 16:55/,/2012-01-05 18:30/p' > file.log.date_range
[/codesyntax]
Have you ever wonder how to grep a file within a date range?
[codesyntax lang="bash"]
cat file.log | sed -n '/2012-01-05 16:55/,/2012-01-05 18:30/p' > file.log.date_range
[/codesyntax]
This site uses Akismet to reduce spam. Learn how your comment data is processed.
You'll get unexpected output if the ending date "2012-01-05 18:30" isn't in the file.log file.