nerdexam
CompTIACompTIA

XK0-005 · Question #163

XK0-005 Question #163: Real Exam Question with Answer & Explanation

The correct answer is D: :%s/\/dev\/sdc/\/dev\/sdd. ALL occurences..so whole file then :%s not just :s.

System Management

Question

Using which of the following control mode commands is the correct way to substitute all occurrences of /dev/sdc with /dev/sdd while editing a file in vi?

Options

  • A:s//dev/sdc//dev/sdd
  • B:s/\/dev\/sdc/\/dev\/sdd/g
  • C:s/\/dev\/sdc/\/dev\/sdd
  • D:%s/\/dev\/sdc/\/dev\/sdd

Explanation

ALL occurences..so whole file then :%s not just :s.

Topics

#vi editor#Text manipulation#Command-line interface#Linux utilities

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions