exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 151 discussion

Actual exam question from CompTIA's XK0-004
Question #: 151
Topic #: 1
[All XK0-004 Questions]

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?

  • 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
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
francocaorlini
Highly Voted 4 years, 4 months ago
ALL occurences..so whole file then :%s not just :s..I think its D http://www.guckes.net/vi/substitute.html
upvoted 15 times
...
igm
Highly Voted 4 years, 4 months ago
why is not D:
upvoted 8 times
...
DiaaEmara
Most Recent 2 years, 5 months ago
D % equal to 1,$ (the entire file) *:%* \/ the next line where the previously used search pattern matches
upvoted 1 times
DiaaEmara
2 years, 5 months ago
http://www.guckes.net/vi/substitute.html
upvoted 1 times
...
...
edwram
2 years, 6 months ago
Selected Answer: D
D is correct
upvoted 1 times
...
o0o0
3 years, 12 months ago
D is the rigth answer...tested!
upvoted 4 times
Mas511
3 years, 7 months ago
Concur. Tested as well.
upvoted 1 times
Didi31
3 years, 3 months ago
Have you taken your exam yet?
upvoted 2 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago