CompTIA
XK0-005 · Question #163
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?
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
How the community answered
(26 responses)- C4% (1)
- D96% (25)
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.