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 ?    22 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

Explain mount and unmount command.

0 Answers  


what is difference between unix and linux?

6 Answers   IBM, Shell, Wipro,


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

8 Answers   TCS,


Write a command to find all of the files which have been accessed within the last 30 days.

5 Answers   Google, IBM, Satyam,


How to add content of one file into another file at the beginning

12 Answers  






Hi All, Can you please let me know how to grep for a particular pattern in unix. I want to print the dates from the file exp.txt. the date pattern is DD:MM:YYYY, I just want to print all the dates from the file exp.txt.

8 Answers   Concentrix, IBM, Symantec, TCS,


what is virtual machine?

2 Answers   Infosys,


What are some command words?

0 Answers  


Write a command that will output the sorted contents of a file named in.txt and place the output in another file named out.txt, while at the same time excluding duplicate entries.

1 Answers  


What does this command do,"$more readme.txt“?

0 Answers  


Assume that a file’s permissions give you read and write access. What operations can you perform on the file if it is in a directory which has “r”(read) only process? What operations can you perform on the file if it is in a directory which has “x”(execute) only access?

1 Answers  


what are the uses of filters?

3 Answers  


Categories