New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 101-500 Exam - Topic 4 Question 115 Discussion

Actual exam question for LPI's 101-500 exam
Question #: 115
Topic #: 4
[All 101-500 Questions]

Which of the following commands changes all occurrences of the word ''bob'' in file data to ''Bob'' and prints the result to standard output?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

0/2000 characters
Noah
2 months ago
C looks tempting, but it won't replace all occurrences.
upvoted 0 times
...
Freeman
2 months ago
I thought it was A at first, but B makes more sense.
upvoted 0 times
...
Elbert
2 months ago
Definitely agree, B is the way to go.
upvoted 0 times
...
Lezlie
3 months ago
Option B is the correct one!
upvoted 0 times
...
Jesus
3 months ago
Wait, why does B have a 'g'? Is that really necessary?
upvoted 0 times
...
Virgie
3 months ago
I thought the command needed to end with a 'g' for it to change all occurrences, but I can't recall if that's in option B or not.
upvoted 0 times
...
Anglea
3 months ago
I practiced a similar question, and I feel like the correct answer should have the 's' and 'g' together. So, B seems right to me.
upvoted 0 times
...
Chau
4 months ago
I'm not entirely sure, but I remember something about using slashes in sed commands. Was it option A?
upvoted 0 times
...
Stephanie
4 months ago
I think the command needs to include a 'g' for global replacement, so maybe it's option B?
upvoted 0 times
...
Valentin
4 months ago
I think the answer is B. The 's/bob/Bob/g' syntax looks right to me for replacing all instances of 'bob' with 'Bob' in the file 'data'.
upvoted 0 times
...
Ty
4 months ago
I'm a bit unsure about this one. I know sed is powerful for text processing, but I'm not super familiar with the different syntax options. I'll have to review my notes before deciding.
upvoted 0 times
...
Simona
4 months ago
The key here is the 'g' flag in the sed command, which stands for 'global' and ensures all occurrences are replaced, not just the first one. I'd go with B.
upvoted 0 times
...
Loreen
5 months ago
Hmm, I'm a bit confused on this one. I know sed is used for text manipulation, but I'm not totally sure about the specific syntax. I'll have to think this through carefully.
upvoted 0 times
...
Oliva
5 months ago
I'm pretty sure the answer is B. The 's/bob/Bob/g' syntax in sed is used to replace all occurrences of 'bob' with 'Bob'.
upvoted 0 times
...

Save Cancel