Within the Stratos DC, the backup server holds template XML files crucial for the Nautilus application. Before utilization, these files require valid data insertion. As part of routine maintenance, system admins at xFusionCorp Industries employ string and file manipulation commands.
Your task is to substitute all occurrences of the string Random with Cloud within the XML file located at /root/nautilus.xml on the backup server.
-
Connect to the server:
ssh clint@stbkp01
-
Switch to root user:
sudo su
-
Count occurrences of
Random
:cat /root/nautilus.xml | grep 'Random' | wc -l
OutPut:
66
-
Create a backup of the file:
cp /root/nautilus.xml /root/nautilus.xml.bak
-
Replace
Random
withCloud
:sed -i 's/Random/Cloud/g' /root/nautilus.xml
-
Verify there are no remaining
Random
strings:cat /root/nautilus.xml | grep 'Random' | wc -l
OutPut:
0
-
Verify the number of
Cloud
strings:cat /root/nautilus.xml | grep 'Cloud' | wc -l
Output:
66