How to find and replace the below command?

Answers were Sorted based on User's Feedback



How to find and replace the below command? ..

Answer / muralidharan

In a vi mode

:%s/searchword/replacaceword/g

Is This Answer Correct ?    17 Yes 0 No

How to find and replace the below command? ..

Answer / pavithra

Using sed command:

sed 's/searchword/replaceword/g' filename --[It finds the
word in file and replaces and displays in the command line]

sed -i '/s/searchword/replaceword/g' filename -- [It edits
the file, finds and replaces the word and saves it and next
time when u open the file it displays the file with replaced
word]

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More Unix Commands Interview Questions

What does sed command do in unix?

0 Answers  


What does the metacharacter mean?

0 Answers  


what does the command 'wc' do?

4 Answers  


in UNIX,what is the command to remove directory with files?

10 Answers  


Which RAID Levels supported by LVM?

5 Answers  


Why is shebang used?

0 Answers  


what is the use of "grep" command?

6 Answers   HCL,


What is the command to check ports active in UNIX?

4 Answers   Accenture, IBM,


How can you change the owner or group of a file?

1 Answers  


what is the advaantage of each user having its own copy of the shell?

0 Answers   BMC, CNS, DELL, Infosys,


What is the difference between grep and grep?

0 Answers  


How do you find files in Unix?

2 Answers  


Categories