Skip to content
Home » Blog » String Operations – Linux Command

String Operations – Linux Command

To find a string and delete the whole line:

find /var/www/vhosts/websitename/httpdocs/ -type f -exec sed -i '/.*pRn9c9o49ufczP0PKuPGuHHAGA.*/d' {} \;

To find a string and replace it with all the files:

find /var/www/vhosts/websitename/httpdocs/ -type f -exec sed -i 's/<?echo/<?php echo/g' {} \;

To find a string in server (all websites)

find /www/*/httpdocs/ -type f -name "*authorize*.*"
find /www/*/httpdocs/ -name '*.php' -exec grep -l "authorize" {} \;

 

Leave a Reply

Your email address will not be published. Required fields are marked *