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

How to see unused port number in Solaris?

2 Answers   HCL,


By using which command we can find the CPU utilization time?

7 Answers   Amazon,


what are processor execution levels and priorities?

2 Answers   Infosys,


what is the meaning of this command rm -rf / what will it do ?

5 Answers   Altair,


What are bash commands?

0 Answers  






How do I search for text in vi?

0 Answers  


what is mount ,tell me about mount ,how can u use in real time project??

12 Answers   Symphony,


Which command is used to copy files?

0 Answers  


How to get the last ten lines of a file using awk utility?

1 Answers   Infosys,


how to check a file system type

7 Answers   Wipro,


What are the general commands in using unix os for a beginner?

0 Answers  


What is the use of tee command?

0 Answers  


Categories