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

What is grep short for?

547


What does grep v do?

551


What is the command to view process running?

566


How do you grep recursively?

545


How can we use grep command in unix?

606






What is awk good for?

578


What does sed command do in unix?

554


How do I delete files from command prompt?

549


What is ‘ps’ command for?

608


why metadb requires a seperate slice to create Solaris volume manager

2544


Explain command to display different lines that are found when compare two files?

671


What happens when we execute a unix command?

590


What does the command ' $who | sort –logfile > newfile' do?

757


What does the metacharacter mean?

604


What is the difference between cat and more command?

618