Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GAQM Exam LCP-001 Topic 3 Question 60 Discussion

Actual exam question for GAQM's LCP-001 exam
Question #: 60
Topic #: 3
[All LCP-001 Questions]

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?

Show Suggested Answer Hide Answer
Suggested Answer: C, E

Contribute your Thoughts:

Dino
27 days ago
Replacing 'foo' with 'foobar'? Sounds like someone's got a case of the Mondays.
upvoted 0 times
...
Corazon
28 days ago
The question is about sed, but I'm feeling a little frazzled. Maybe I should try something more soothing, like awk.
upvoted 0 times
Jolanda
8 days ago
A) sed 's/foo/foobar/g' file1.txt
upvoted 0 times
...
...
Tonette
1 months ago
Seriously, who would choose Option C? Piping the output to the file name is just nonsensical.
upvoted 0 times
...
Layla
1 months ago
I think Option B is the best choice. Redirecting the output to the same file is a surefire way to update the contents.
upvoted 0 times
Cammy
4 days ago
User 3: Cammy is right, Option D is the correct one to replace the string in place.
upvoted 0 times
...
Dierdre
5 days ago
User 2: No, Option B will overwrite the file before reading it.
upvoted 0 times
...
Lauran
10 days ago
User 1: I think Option B is the best choice.
upvoted 0 times
...
...
Gerald
2 months ago
Option D is the way to go. The '-i' flag modifies the file in place, which is exactly what the question asks for.
upvoted 0 times
Goldie
25 days ago
User4: Exactly, option D is the way to go.
upvoted 0 times
...
Stephaine
1 months ago
User3: So we don't need to redirect the output to the same file.
upvoted 0 times
...
Oliva
1 months ago
User2: Yeah, the '-i' flag is used to modify the file in place.
upvoted 0 times
...
Kallie
2 months ago
User1: I think option D is the correct one.
upvoted 0 times
...
...
Estrella
2 months ago
Option A is the correct answer. It uses the 's' command to replace 'foo' with 'foobar' and the 'g' flag to replace all occurrences.
upvoted 0 times
Elina
1 months ago
User2: Thanks for clarifying, I'll go with that option.
upvoted 0 times
...
Dierdre
1 months ago
User1: I think the answer is A) sed 's/foo/foobar/g' file1.txt
upvoted 0 times
...
...
Shawna
2 months ago
I'm not sure, but I think option D makes sense because it uses -i flag for in-place editing.
upvoted 0 times
...
Georgeanna
2 months ago
I agree with Larae, using -i option will change the file in place.
upvoted 0 times
...
Larae
2 months ago
I think the answer is D.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77