Vidyalelo
Computer Science · Q953

Linux

Engineering and GATE · Computer Science · question 953

Q953

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
Answer
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

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board