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 ‘du’ a command? If so, what is its use?
What is the pipe command?
How do I search for a file in unix command?
how many types of file in unix?
34 Answers MNC, TCS,
Explain the read, write, and execute permissions on a UNIX directory.
Explain command to show the space allocation of files?
Give two UNIX kernel parameters that effect an Oracle install
How does the system know where one command ends and another begins?
what is virtual machine?
What are some command words?
How to display no of records in oracle using unix command?
In UNIX, what is the command to kill a process?