What command is used to replace the existing string with
some other?

Answer Posted / pavankumar

sed 's/word1/word2/g' file

it replaces all occurences of word1 with word2 in file.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you see the command line history?

573


What do chmod command do?

592


What do know about tee command?

592


Which command can you use to find the currently running process in unix server?

574


Why is it called grep?

547






How do I search a whole word in vim?

679


What does pipe () return?

581


What is ctrl d?

580


Who wrote grep?

570


What happens when we execute a unix command?

587


Explain ‘library functions’ with respect to unix commands?

590


What difference between cmp and diff commands?

706


Which command is used to delete all files in the current directory and all its sub-directories?

650


What is the behavioural difference between cmp and diff commands?

662


What is s and g in sed command?

544