Multiple choice technology operating systems

You want to repalce "lion" with "tiger" in your field at all location in the vi editor.You use

  1. /s/lion/tiger

  2. s/lion/tiger

  3. s/lion/tiger/g

  4. s/tiger/lion/g

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In vi, the substitute command syntax is ':s/pattern/replacement/g' for global substitution throughout the file. Option A has the correct format with the leading '/' which indicates the command range, though it should be ':s/lion/tiger/g' to replace all occurrences. The leading '/' means 'current line through last line'.