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 |
What Command will remove a Directory in UNIX?
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
How can you create a symbolic link to a file or directory?
What difference between cmp and diff commands?
what is the advaantage of each user having its own copy of the shell?
Which command is used to delete all files in the current directory and all its sub-directories?
fork in unix ?
what is the difference between pipe(|) and tee command..
what are the different operating systems available?
What is awk used for?
what are the different commands used to view the contents of a file?
write grep commands to select the lines that have exactly two characters