nerdexam
CompTIA

LX0-101 · Question #33

Which of the following commands will print to standard out only the lines that do not begin with # (pound symbol) in the file foobar?

The correct answer is B. /bin/grep -v ^# foobar. See the full explanation below for the reasoning.

Question

Which of the following commands will print to standard out only the lines that do not begin with # (pound symbol) in the file foobar?

Options

  • A/bin/grep ^# foobar
  • B/bin/grep -v ^# foobar
  • C/bin/grep #$ foobar
  • D/bin/grep -v #$ foobar

How the community answered

(31 responses)
  • A
    16% (5)
  • B
    74% (23)
  • C
    3% (1)
  • D
    6% (2)

Community Discussion

No community discussion yet for this question.

Full LX0-101 Practice