I'm fairly new to Linux and recently started experimenting with the command line. I decided to make a file and called it 'hi.txt'. The contents of the document was:
This is hi.txt. hi hi hi
I used the command
sed -i 's/hi/hotel/g' hi.txt in hopes of making all the 'hi's in the document change to hotel. This was the output:
Thotels is hotel.txt hotel hotel hotel
As you can see, the 'hi' is the word 'This' also got changed. Is there a way to stop this from happening?