I opened a text file in vi editor and typed the following command while in escape mode. :3 s/abc/xyz/
It looks for the all the abc strings in line 3 and replaces them to xyz.
It looks for the first abc string in the first 3 lines and replaces to xyz.
It looks for the first abc string in line 3 and replaces to xyz.
It looks for the first 3 abc string in the file and replaces them to xyz.