string replacement kodekloud Level 1 Linux KodeKloud Engineer Task Success

Ticker

6/recent/ticker-posts

string replacement kodekloud Level 1 Linux KodeKloud Engineer Task Success

 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.

Please Note :-  Perform the below commands based on your question  server,  user name & other details might differ. 
So please read task carefully before executing. 
All the Best 👍

Solution:  

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 ~]#


2. Pull out the string About on the XML file /root/nautilus.xml

[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 ~]#



5. confirm the change in string Maritime

[root@stbkp01 ~]# cat /root/nautilus.xml  |grep Maritime |wc- l

66

[root@stbkp01 ~]#


6. Click on Finish & Confirm to complete the task successful

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this 

please go through and share your comments. Like and share the knowledge


Post a Comment

0 Comments

Latest Posts

 Restrict Cron Access Level 1 Linux KodeKloud Engineer Task Success