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 |
Is there any command in Unix, other than:ls, to list the files in a directory? The answer will be highly appreciated...
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)?
Is grep faster than awk?
What is the command to find hidden files in the current directory?
What is the difference between pipe and xargs?
How do you repeat a command in terminal?
Describe the usage and functionality of the command rm –r * in unix?
what is the command to list all files in a directory, including the hidden files in UNIX ?
Write a command that will display files in the current directory, in a colored, long format.
what do you understand by 'unix is a portable os'?
What does 'mkdir' command do in UNIX?
How to copy multiple files and directories into some other directory?