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

Answers were Sorted based on User's Feedback



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

Answer / thangaraju

sed 's/existingstring/newstring/g' filename or Specfied
row means sed '1,10s/existingstring/newstring/g' filename

Is This Answer Correct ?    23 Yes 1 No

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

Answer / jaga

:%s/string/String1/g

Is This Answer Correct ?    12 Yes 2 No

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

Answer / 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

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

Answer / vishu146

:1,$s/string/string1/gc

Is This Answer Correct ?    2 Yes 0 No

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

Answer / angel

sed command

Is This Answer Correct ?    2 Yes 1 No

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

Answer / amit kumar

sed 's/existing_word/new_word/g' file1.txt.It replaces the
all the existing word with new word wherever it occurs in
file1.g stands for global.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / drishya

:g/existing word/s//new word

this s can be used while using C in linux...

Is This Answer Correct ?    1 Yes 1 No

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

Answer / 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

More Unix Commands Interview Questions

What do chown command do?

0 Answers  


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

0 Answers  


What is pipe command in unix?

0 Answers  


What is awk good for?

0 Answers  


How do I open a port?

0 Answers  


What is the difference between pipe (|) and tee command in unix

14 Answers   Cap Gemini, TCS,


How to find $ai_serual resolved path by using unix

0 Answers  


distinguish between user mode and kernel mode?

4 Answers   Infosys,


How i'll delete a particular line from the file? Please give answer as soon as possible. Thanks in advance.

12 Answers   IBM,


What is $0 bash?

0 Answers  


What is command substitution?

0 Answers  


How to install scsi driver in unix? give me explanation clearly?

1 Answers   HCL, TCS,


Categories