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 / shilpi gupta

sed 's/\<amaze\>/delight/g' file_name

or

In Vi editor..you can use

:%s/\<amaze\>/delight/g

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a bash command?

624


What does the md command do?

568


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

589


What is the comma to display different lines that are found when compare two files?

593


Is command prompt unix?

579






What do chgrp command do?

590


What are the general commands in using unix os for a beginner?

577


Does cp command overwrite files?

620


What are the commands in UNIX to list the files in a Directory?

616


How do I delete files from command prompt?

549


What is .sh file?

616


What is the difference between awk and grep?

558


Which command is used to restrict incoming messages?

592


What's a command word?

586


What is the first character of the output in ls l command?

631