Posted on

Linux+ – LX0-101 – Exam 1 Samples – Question 60

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

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

This Question is from the premium VCE/PDF and it is available for you here for free.

Correct Answer: D

Leave a Reply

Your email address will not be published. Required fields are marked *