Write a command to replace the word “bad” with “good” globally in a file?

sed s/bad/good/g < filename

Category: UNIX Interview Questions.