How to do a search and replace over multiple files

linux konsolda Birden cok dosya icinde bul ve degistir islemleri yapmak.

Bu kod yeni sunuculardan bir tanesine aktarilan domainlerin dnslerinde yapilmasi gereken degisikler icin gerekti.

Basariyla uygulandi.

ingilizce metin su sekilde:

You could also use find and sed, but I find that this little line of perl works nicely.
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

Example I had the following style sheet in a section:
and I wanted the following instead:
As each expression is a regular expression you’ve got to escape the special characters such as forward slash and .

So the final line of code ends up as
perl -pi -w -e ‘s/\.\.\/includes\/style\.css/admin\.css/g;’ *.php

Benim uguladigim sekilde ise :

/var/named/*.db dosyalarinda
ile degistirilmesi gerek

[root@pbserver named]# perl -pi -w -e 's/ns1\.eskidomain\.net\./ns1\.yenidomain\.org\./g;' *.db
[root@pbserver named]# perl -pi -w -e 's/ns2\.eskidomain\.net\./ns2\.yenidomain\.org\./g;' *.db



EK 1 KASIM 2017


find and replace etmenin yolu daha degisik sekilde

for E in `cat aaa.txt`; do perl -pi -w -e 's/content type/content_type/g;' $E; done