Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 1.25 KB

String Replacement.md

File metadata and controls

67 lines (44 loc) · 1.25 KB

Problem Statement

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.

Solution

  1. Connect to the server:

    ssh clint@stbkp01
  2. Switch to root user:

    sudo su
  3. Count occurrences of Random:

    cat /root/nautilus.xml | grep 'Random' | wc -l

    OutPut:

    66
    
  4. Create a backup of the file:

    cp /root/nautilus.xml /root/nautilus.xml.bak
  5. Replace Random with Cloud:

    sed -i 's/Random/Cloud/g' /root/nautilus.xml
  6. Verify there are no remaining Random strings:

    cat /root/nautilus.xml | grep 'Random' | wc -l

    OutPut:

    0
    
  7. Verify the number of Cloud strings:

    cat /root/nautilus.xml | grep 'Cloud' | wc -l

    Output:

    66