How to replace the exact word in vi editor??
suppose a file contains words like amaze,amazed,amazement in
some of the line.But i want to replace only 'amaze' with
delight but don't wanna replace amazed or amazement.
thanks

Answer Posted / supreet goswami

sed-i "s| amaze |delight|g" filename

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do chown command do?

536


How many unix commands are there?

631


Which command is used to copy files?

559


How does pipe () work?

598


What is the command to view process running?

578






What is the use of cut command in unix?

696


How do I clear my terminal history?

588


Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

963


What do chmod command do?

606


What are the differences among a system call, a library function, and a unix command?

571


How do I search for text in vi?

590


What is in grep command?

652


What do know about tee command and its usage?

591


What is grep in bash?

591


What is s and g in sed command?

563