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 do I run a whois command?

0 Answers  


what is tar command and what are the different types of tar commands?

5 Answers  


How to view the hidden files in /etc directory?

10 Answers  


Write a command that will display files in the current directory, in a colored, long format.

0 Answers  


distinguish between user mode and kernel mode?

6 Answers   Infosys,


What is the command to compare two files in unix?

0 Answers  


hi i have directories within the directory. Now i want to copy the directory along with all directories included in it to one location by using copy command? what is the command

2 Answers   ACS, Span Systems,


What is a bash command?

0 Answers  


How do I search for a file in unix command?

0 Answers  


How do I use nslookup?

0 Answers  


can we use cat command as an editor ..???

12 Answers   TCS,


what is the default signal kill in unix?

8 Answers   IBM,


Categories