nerdexam
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)
  • A
    13% (6)
  • B
    4% (2)
  • C
    6% (3)
  • D
    2% (1)
  • E
    75% (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.

Full 101-500 Practice