nerdexam
LPI

101-400 · 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. See the full explanation below for the reasoning.

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

(30 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    83% (25)
  • D
    10% (3)

Community Discussion

No community discussion yet for this question.

Full 101-400 Practice