How would you change all occurrences of a value using VI?
Answers were Sorted based on User's Feedback
Answer / sridhar
press esc+shift
then when the VI takes u to the edit mode use the following.
:%s/pattern/new value/g
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / sameer
press esc+shift
then when the VI takes u to the edit mode use the following.
:1,$s/pattern to be changed/new value/g
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / chitra
One should be in command mode for doing this.(i.e press esc)
:%s/oldpattern/newpattern and press enter
| Is This Answer Correct ? | 3 Yes | 4 No |
How do you move or rename a file or directory?
What is pid?
Why is it called a shebang?
What is the Unix file system hierarchy?
How we will execute previous command in vi editor?
what is the use of uniq commmand?
How do you grep a case insensitive?
What is ‘ps’ command for?
what is the command to get help on a UNIX terminal?
What does touch command do in unix?
What is the difference between udp and tcp?
What is the difference between pipe (|) and tee command in unix