[Tfug] Quick command line question...
brandons.daemon at gmail.com
Wed Mar 10 08:55:21 MST 2010
On Wed, Mar 10, 2010 at 8:49 AM, brandon <brandons.daemon at gmail.com> wrote:
> On Wed, Mar 10, 2010 at 8:41 AM, Jim March <1.jim.march at gmail.com> wrote:
>> Say I've got a bunch of text files in a directory...all ending with
>> .TXT...a dozen or so.
>> I know that in some, a particular word isn't spelled right - say,
>> "regurjitation". I want to do a command to search for that and
>> replace it with "regurgitation" across all files where the bad one is
>> found, and save all files to their original names.
>> Any help appreciated :).
>> Tucson Free Unix Group - tfug at tfug.org
>> Subscription Options:
> Hi Jim-
> Not sure what distro you are using but there is a nice perl utility
> 'rename' that is on most.
> man rename
> Then you can do something like this to get an idea of what would happen.
> rename -n 's/regurjitation/regurgitation/' *.TXT
Oh I think I didn't read that =) That will rename the files and not the
words in the files!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the tfug