LPI
101-500 · Question #488
Given a log file loga.log with timestamps of the format DD/MM/YYYY:hh:mm:ss, which command filters out all log entries in the time period between 8:00 am and 8:59 am?
The correct answer is E. grep -E `:08:[0-9]+:[0-9]+' loga.log. You've hit your Sonnet limit · resets Jun 8, 9am (UTC)
GNU and Unix Commands
Question
Given a log file loga.log with timestamps of the format DD/MM/YYYY:hh:mm:ss, which command filters out all log entries in the time period between 8:00 am and 8:59 am?
Options
- Agrep -E `:08:[09]+:[09]+' loga.log
- Bgrep -E `:08:[00]+' loga.log
- Cgrep -E loga.log `:08:[0-9]+:[0-9]+'
- Dgrep loga.log `:08:[0-9]:[0-9]'
- Egrep -E `:08:[0-9]+:[0-9]+' loga.log
How the community answered
(48 responses)- A13% (6)
- B4% (2)
- C6% (3)
- D2% (1)
- E75% (36)
Explanation
You've hit your Sonnet limit · resets Jun 8, 9am (UTC)
Topics
#grep#regular expressions#pattern matching#log filtering
Community Discussion
No community discussion yet for this question.