Search files and replace string in all files

Hi,

I need to find all in directory /var/www/ recursively with extension .txt and replace string in each file. The files contain string: admin and I need to change it to administrator.

thanks

Hi,

I need to find all in directory /var/www/ recursively with extension .txt and replace string in each file. The files contain string: admin and I need to change it to administrator.

thanks

Hi,

Please use following bash command

find /var/www/ -type f -iname “*.txt” -print0 | xargs -0 sed -i ‘s/admin1/administrator/g’

Thanks

bnhashmi

worked…I only had to change admin1 to admin

thank you…