Find and replace across multiple files
If you are using assistive technology and are unable to read any part of the HostMonster website, or otherwise have difficulties using the HostMonster website, please call 866-573-HOST and our customer service team will assist you.
Skip to main content

HostMonster Web Hosting Help

Find and replace across multiple files

With SSH command line access, you can do the following to edit several individual pages to replace a string of text e.g. update the phone number on the footer of every page on your site.
              * perl -pi -w -e 's/search/replace/g;' *.php
                -e means execute the following line of code.
                -i means edit in-place
                -w write warnings
                -p loop
              * find ./ -type f -exec sed 's/search/replace' {} \;
            
Knowledgebase Article 162,032 views bookmark tags: command find replace ssh


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

How to restore individual files or folders with the Site Backup & Restore tool
Knowledgebase Article 430,629 views tags: backup files folders restore site

This article will instruct you how to export a database from the command line (SSH).
Knowledgebase Article 866,988 views tags: database mysql ssh

I am trying to edit my web page and I have no idea how to? I need to know how to go into the site and fix it. My webpage has a error in the first paragraph. I don't know how to fix it? Can you help?
Knowledgebase Article 415,846 views tags: edit html upload webpage

Related Help Content

This article will instruct you how to import a database from the command line (SSH).
Knowledgebase Article 780,265 views tags: database mysql ssh

Is SSH/Shell access enabled by default?
Knowledgebase Article 879,700 views tags: bash command line secure shell ssh

This article will show a way to protect specific pages of your website with SSL. This may have benefits for SEO and can be used on pages that contain forms, shopping carts or any other page where users might enter sensitive information.
Knowledgebase Article 124,743 views tags: htaccess pages specific ssl

How to Transfer hosted files from old host to HostMonster.com via ssh. Your old host must have SSH access to perform this move. Using SSH to transfer files to HostMonster
Knowledgebase Article 246,599 views tags: file host site transfer transferring

What is SSH and how do I setup secure connections.
Knowledgebase Article 490,405 views tags: bash connect putty shell ssh

If suddenly when you go to your page, you get nothing on the page. You can still get HTML to display, just not PHP. To serve HTML pages to browsers, we don't associate the Apache processes with your 2
Knowledgebase Article 193,476 views tags: blank page php

This article explains how to find the database in use by a WordPress site.
Knowledgebase Article 336,338 views tags: database find wordpress

This article explains error pages and how they can be customized.
Knowledgebase Article 323,188 views tags: customize pages

This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here