Find the answer to your Linux question:
Results 1 to 2 of 2
Hey, Is there any way to edit say something like 25 files at once. What I need it for is for my web developing. I develop locally and I want ...
  1. #1
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474

    Script that replaces text in many files

    Hey,

    Is there any way to edit say something like 25 files at once. What I need it for is for my web developing. I develop locally and I want to change all the links from "http://localhost/" to "http://sedia.110mb.com/" and I have many pages.

    Thanks in advance to any help

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Hi,

    To edit all html files in a directory you can do something like:

    Code:
    sed -i 's_http://localhost/_http://sedia.110mb.com/_g' *.html
    Regards
    Last edited by Franklin52; 08-21-2007 at 04:20 PM. Reason: add global option

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...