Find & Replace string

Parv parv at pair.com
Fri Dec 10 18:03:49 PST 2004


in message <019101c4de0e$dbdeb2d0$0200000a at SAGEAME>,
wrote antenneX thusly...
>
> In a website of 1.GB+ with several hundred thousand files, I need
> to interrogate all files to replace a single string like
> "oldone.010" with "newone.011"
> 
> What's the best way to do this?

Find yourself if the following is the best way ...

  fgrep -r -l 'oldone.010'  parent-directory-of-files \
  | xargs perl -pi -e 's[oldone\.010]/newone.011/g'


  - Parv

-- 



More information about the freebsd-questions mailing list