PrepAway - Latest Free Exam Questions & Answers

Which of the following sed commands will replace all instances of the string foo with the stringfoobar changin

Which of the following sed commands will replace all instances of the string foo with the string
foobar changing the file filel.txt in place?

PrepAway - Latest Free Exam Questions & Answers

A.
sed ‘s/foo/foobar/g’ file1.txt

B.
sed ‘s/foo/foobar/g’ file1.txt > file1.txt

C.
sed ‘s/foo/foobar/g’ file1.txt | file1.txt

D.
sed -i ‘s/foo/foobar/g’ file1.txt

E.
sed -i ‘s/foo/foobar/g’ file1.txt > file1.txt


Leave a Reply