Examveda

Which command is used to replace word 'cat' (already present in the file) with 'mouse' at all places in a file 'old.txt' and save the result in a new file 'new.txt'?

A. sed 's/cat/mouce/g' old.txt > new.txt

B. sed 's/cat/mouse' old.txt new.txt

C. sed '/s/cat/mouse/g' old.txt new.txt

D. sed '/s/cat/mouse' old.txt > new.txt

Answer: Option A


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux