How would you change all occurrences of a value using VI?

Answers were Sorted based on User's Feedback



How would you change all occurrences of a value using VI?..

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

How would you change all occurrences of a value using VI?..

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

How would you change all occurrences of a value using VI?..

Answer / dinesh

:%s/pattern/new value/g

Is This Answer Correct ?    6 Yes 0 No

How would you change all occurrences of a value using VI?..

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

Post New Answer

More Unix Commands Interview Questions

Why we are using UNIX OS when we are doing the testing in our application?

5 Answers   IBM,


in a growing log file how will you see the 1st 99 lines?

7 Answers  


What does the command '$ls | wc –l > file1' do?

0 Answers  


What is merge command in unix?

0 Answers  


what is the significance of "su" command?

3 Answers  






How to display a file name which has zero bytes in size.

11 Answers   Polaris,


What command is used to switching between users in unix?

0 Answers  


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include<stdlib.h> # include <stdio.h> int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

0 Answers  


Give Command that will change the name of a directly from paypal to eBay

3 Answers   Alcatel, IBM,


Write a command to kill the last background job?

0 Answers  


what is the difference between npar and vpar in HP-UX?

1 Answers   CSC,


Can you explain a little bit about command substitution?

0 Answers  


Categories