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 |
Write a command that will output the sorted contents of a file named in.txt and place the output in another file named out.txt, while at the same time excluding duplicate entries.
How to get the last ten lines of a file using awk utility?
why metadb requires a seperate slice to create Solaris volume manager
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
Which command is used to restrict incoming messages?
What is the difference between grep and grep?
What does the md command do?
how will you login one server's shell prompt to an another server?
5 Answers Cosmic Infotech, Perot Systems,
What is the comma to show the space allocation of files?
What do chown command do?
What is the comma to display different lines that are found when compare two files?
Suppose 1000 processes are running on the system out of those if you have to show only certain process ids which command will you use?