How to find and replace the below command?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it called grep?

565


What is grep short for?

558


How do I use nslookup?

577


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

650


What is the use of tee command?

573






What difference between cmp and diff commands?

729


What command is used to check the current users?

598


What is time_t?

590


Why is grep called grep?

784


What does grep v grep do?

556


Describe the usage and functionality of the command rm –r * in unix?

830


What is unix command?

586


What are bash commands?

601


What is used to type command?

549


Which command is used to create a directory?

577