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
Related Questions on Linux
What command is used to count the total number of lines, words, and characters contained in a file?
A. countw
B. wcount
C. wc
D. count p
E. None of the above
What command is used with vi editor to delete a single character?
A. x
B. y
C. a
D. z
E. None of the above
Join The Discussion