Multiple choice technology operating systems

I opened a text file in vi editor and typed the following command while in escape mode. :3 s/abc/xyz/

  1. It looks for the all the abc strings in line 3 and replaces them to xyz.

  2. It looks for the first abc string in the first 3 lines and replaces to xyz.

  3. It looks for the first abc string in line 3 and replaces to xyz.

  4. It looks for the first 3 abc string in the file and replaces them to xyz.

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

The vi command ':3 s/abc/xyz/' means: on line 3, substitute (s) the first occurrence of 'abc' with 'xyz'. The '3' before s specifies the line number. Without the 'g' flag, only the first match is replaced. Option A is wrong (no global flag). Option B is wrong (only line 3, not first 3 lines). Option D is wrong (line 3, not first 3 matches).