What command is used to replace the existing string with
some other?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
how to sort the content of the file based on numeric values
what is the use of "test" command in unix?
Explain how to use grep command to list find the records of a file containing 10 different strings?
How do you find files in Unix?
How do you create a file in UNIX
36 Answers Accenture, EMG, Nokia, QA, TD,
How do I search a whole word in vim?
In UNIX, what is the command to edit contents of the file?
What is the use of touch command in there?
How i'll delete a particular line from the file? Please give answer as soon as possible. Thanks in advance.
The command grep first second third /usr/you/myfile a) prints lines containing the words first, second or third from the file /usr/you/myfile b) searches for lines containing the pattern first in the files second, third, and /usr/you/myfile and prints them c) searches the files /usr/you/myfiel and third for lines containing the words first or second and prints them d) replaces the word first with the word second in the files third and /usr/you/myfile e) None of the above
What is unix command?
By using which command we can find the CPU utilization time?