nerdexam
LPI

101-500 · Question #21

Which grep command will print only the lines that do not end with a / in the file foo?

The correct answer is C. grep -v '/$' foo. You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

GNU and Unix Commands

Question

Which grep command will print only the lines that do not end with a / in the file foo?

Options

  • Agrep '/$' foo
  • Bgrep '/#' foo
  • Cgrep -v '/$' foo
  • Dgrep -v '/#' foo

How the community answered

(54 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    93% (50)
  • D
    2% (1)

Explanation

You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

Topics

#grep command#regex anchors#inverted matching#pattern matching

Community Discussion

No community discussion yet for this question.

Full 101-500 Practice