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 |
if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command use in unix? plz send this question.
How can i know my Filesystem and its current usage in my prod UNIX system?
How to set sticky bit, or it have any seperate directory to create sticky bit in sunfir servers. Please help me , i don't no the exact answer?
How to add content of one file into another file at the beginning
What is the function of grep command in unix?
How do you create a directory in UNIX?
What is grep short for?
What is the behavioural difference between cmp and diff commands?
boot process?
What are file permissions in Unix, and how are they represented?
What is ctrl d?
Is command prompt unix?