How do I write the sed command to specify that I want to substitute a word e.g f . . .

Kylie Collins:
How do I write the sed command to specify that I want to substitute a word e.g for and and not letters in a word e.g _for_ms?

Inbharaj:
Try sed ‐i ‘s/\bfor\b/newword/g’ file.txt

Kylie Collins:
@Inbharaj Thanks! I will try it and let you know

Kylie Collins:
@Inbharaj It worked! Thank you!:thumbsup: