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 |
their is a file1,file2 and i want to append file1 data to file2?
How would you find the size of a file or directory?
What is the general format of unix command syntax?
What is clustering in HP and how it's work?
In UNIX, what is the command to edit contents of the file?
what is the command to print last 8 lines of any text file.
What command is used to check the current users?
what is virtual machine?
what are the different operating systems available?
can we use cat command as an editor ..???
What is grep r?
What does sed command do in unix?