nerdexam
LPI

101-400 · Question #23

Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?

The correct answer is D. sed 's/bob/Bob/g' letter > newletter. See the full explanation below for the reasoning.

Question

Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?

Options

  • Ased '/bob/Bob' letter > newletter
  • Bsed s/bob/Bob/ letter < newletter
  • Csed 's/bob/Bob' letter > newletter
  • Dsed 's/bob/Bob/g' letter > newletter
  • Esed 's/bob, Bob/' letter > newletter

How the community answered

(50 responses)
  • A
    2% (1)
  • B
    16% (8)
  • C
    8% (4)
  • D
    72% (36)
  • E
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 101-400 Practice