LPI
117-010 · Question #61
Given a file called birthdays containing lines like: YYYY-MM-DD Name 1983-06-02 Tim 1995-12-17 Sue Which command would you use to output the lines belonging to all people listed whose birthday is in…
The correct answer is C. grep '[0-9]*-0[56]-' birthdays. See the full explanation below for the reasoning.
Question
Given a file called birthdays containing lines like:
YYYY-MM-DD Name 1983-06-02 Tim 1995-12-17 Sue Which command would you use to output the lines belonging to all people listed whose birthday is in May or June?
Options
- Agrep '[56]' birthdays
- Bgrep 05?6? birthdays
- Cgrep '[0-9]*-0[56]-' birthdays
- Dgrep 06 birthdays | grep 05
How the community answered
(30 responses)- A3% (1)
- B10% (3)
- C83% (25)
- D3% (1)
Community Discussion
No community discussion yet for this question.