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 check whether some services are running in another server or not? Suppose i am currently in a server named A.I want to check whether some services are running in server B without logging into the server B.

3 Answers   Amazon, MBA, Syntel, TCS, Unisys,


What is the syntax of grep command and what is its use?

6 Answers  


what does a process mean?

5 Answers   Infosys,


Can you explain a little bit about command substitution?

0 Answers  


Why is it called grep?

0 Answers  






Can a process kill itself in UNIX/or in its various versions?

2 Answers  


what do you understand by 'building block primitive'?

0 Answers   Infosys,


when we installing aix os the ssh installed default?

2 Answers  


what is the difference between commmands cmp and diff?

9 Answers   iNautix,


how unix kernel distinguishes between a normal file and device file ?

7 Answers   Google, IBM, McAfee, Vodafone,


1-how will you display a file whose name is starting with '- '? 2-how will you add a patten at end of every line in vi editor?

7 Answers  


What Is the command to change a file's creation time. means one file is created at the time 15:19 then time should br changed to 14:14

8 Answers   3i Infotech, IBM,


Categories