grep and replace string in many files

OOzy Pal oozypal at gmail.com
Fri Mar 9 11:29:19 UTC 2007


On 3/9/07, OOzy Pal <oozypal at gmail.com> wrote:
> On 3/9/07, Carsten Aulbert <carsten at welcomes-you.com> wrote:
> > OOzy Pal wrote:
> > > How can I replace each occurrences of 'images/' to 'img/' (quotes are
> > > not included) from all my html files?
> >
> > There are many ways to do it.
> >
> > I would, for example, use something like that:
> >
> > find . -name "*html" | xargs -n1 perl -i -ane 's/images/img/g; print;'
> >
> > but your milage might vary and please test this first on a copy of the data.
> >
> > HTH & don't blame me for my faults ;)
> >
> > Carsten
> >
> > --
> > ubuntu-users mailing list
> > ubuntu-users at lists.ubuntu.com
> > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> >
>
> :), don't worry I won't. I will test now.
> --
> OOzy
> Kubuntu-Edgy
>

Worked ok.

Thank you.
-- 
OOzy
Kubuntu-Edgy




More information about the ubuntu-users mailing list