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 |
Explain mount and unmount command.
How i'll delete a particular line from the file? Please give answer as soon as possible. Thanks in advance.
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
What is pipe command in unix?
How to copy multiple files and directories into some other directory?
How do you copy a directory with many files and folders into another directory?
what does a process mean?
how to find the 51th record of a file containing 100 records in unix.
What command is used to switching between users in unix?
Explain iostat, vmstat and netstat.
Why is shebang used?
What does mkdir up2date; touch outdated up2date do?