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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kranthi kumar
:1,$s/amaze$/amazing/g
this will be changed only amaze in totalvi editor....
Is This Answer Correct ? | 2 Yes | 3 No |
How to get a particular string as your prompt ? Give syntax of that command?
What does awk stand for?
Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.
How does a user get the current date, time in UNIX?
What are awk commands?
Write a command to kill the last background job?
What is grep short for?
what is the use of "test" command in unix?
Can you write a command to erase all files in the current directory including all its sub-directories?
what do you understand by 'unix is a portable os'?
What does mkdir up2date; touch outdated up2date do?
What is command substitution?