Linux String Substitute task error

The task is to remove the occurrences of ‘Text’ by ‘Architecture’ in nautilus.xml file which is present in the backup server.

the command I used: sed ‘s/Text/Architecture/’ /root/nautilus.xml

The error which I got: all occurrences of ‘Text’ have not changed to ‘Architecture’ in the file ‘/root/nautilus.xml’ on stbkp01

Hello @dineshkumar14,
can you please provide us the link of the task.

Hello, @dineshkumar14
You have to add -i flag with sed command. Without a flag it will show you only stdout.
You can verify with the cat command.

you also have to add a ‘g’ at the end to make replacements ‘global’. By default, sed will just do one replacement per line. With ‘g’ it replaces everything.

Example with some random test file I made:

$ sed 's/Text/Architecture/' test.txt
this is a Architecture on Text where Text
is a very important Architecture.

But Architecture is Text.
$ sed 's/Text/Architecture/g' test.txt
this is a Architecture on Architecture where Architecture
is a very important Architecture.

But Architecture is Architecture.