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 the use of find command in unix?

588


What is ctrl d?

596


What is the command to view process running?

578


Which command is used to find whether the system is 32 bit or 64 bit?

633


What does 'mkdir' command do in UNIX?

662






What difference between cmp and diff commands?

727


What does #!/ Bin sh do?

597


What does awk stand for?

615


What are bash commands?

599


Can you explain a little bit about command substitution?

612


Describe the zip/unzip command using gzip.

615


Who command in unix operating system?

667


What is the command to find hidden files in the current directory?

587


what is the advaantage of each user having its own copy of the shell?

2039


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

637