Question : 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 Sample with Maritime within the XML file located at /root/nautilus.xml on the backup server.
1. At first login on Backup server & Switch to root user
thor@jump_host ~$ ssh clint@stbkp01 The authenticity of host 'stbkp01 (172.16.238.16)' can't be established. ECDSA key fingerprint is SHA256:QxlPU0/gV0gyK8YIJGOoEnxj57cSuTtirpTMzGdgKTM. ECDSA key fingerprint is MD5:9f:8e:c0:1d:38:01:56:86:6d:85:b3:3f:69:6a:7c:44. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'stbkp01,172.16.238.16' (ECDSA) to the list of known hosts. clint@stbkp01's password: [clint@stbkp01 ~]$ sudo su - We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for clint: [root@stbkp01 ~]# |
[root@stbkp01 ~]# cat /root/nautilus.xml |grep Sample | wc -l 66 [root@stbkp01 ~]# |
4. Replace the string About to Maritime with the help of sed command
[root@stbkp01 ~]# sed -i 's/Sample/Maritime/g' /root/nautilus.xml [root@stbkp01 ~]# |
[root@stbkp01 ~]# cat /root/nautilus.xml |grep Maritime |wc- l 66 [root@stbkp01 ~]# |
Happy Learning!!!!
0 Comments