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

Answer Posted / suresh mishra

sed 's/existing_pattern/new_pattern/g' file_name :- It replaces "existing_pattern" with "new_pattern" GLOBALLY.If you are not providing 'g' at the end, it will only replace the first occurrence of the matching pattern.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is awk called awk?

577


What is the difference between cat and more command?

627


how to sort the content of the file based on numeric values

1252


What is difference between grep and find command in unix?

577


hw will u use awk in replacing cahrs and files

2733






How do I search for text in vi?

586


Which command should you use to find the remaining disk space in unix server?

707


How does pipe () work?

595


What is the functionality of a top command?

625


How do I use grep to search for a file?

580


How do you grep recursively?

557


Enlist some filename manipulation commands in unix.

552


Can you explain a little bit about command substitution?

610


What are bash commands?

595


What is updatedb?

586