101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 87


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 Answer
Correct Answer: B

The command 'sed‘s/bob/Bob/g’ data' correctly uses the 's' command in sed to substitute every occurrence of the word 'bob' with 'Bob' in the file 'data'. The 'g' at the end stands for 'global', meaning it will replace all occurrences in each line, not just the first occurrence. Other options either have incorrect syntax or do not apply the substitution globally.

Discussion

1 comment
Sign in to comment
cast7omadrid1
Jun 8, 2020

it is repeated