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 do I find previous commands in unix?

594


What is grep and how do you use it?

577


What are the unix commands?

560


What do chgrp command do?

590


What are reported commands?

566






Why is awk called awk?

577


Which command will print your home directory on screen?

546


How do you grep a case insensitive?

540


What is the use of sed command in unix?

601


What is $0 bash?

649


Which command is used to find whether the system is 32 bit or 64 bit?

631


What is a bash command?

627


What's a command word?

591


Are you in or at the office?

611


Which command is used to create a directory?

575