Deleting error_log on mass

I’ve recently moved to new VPS servers and something that you need to be careful with is an incorrect setup in your php.ini file. Just a small typo can result in a line of errors everytime a PHP page is loaded, and on a WordPress blog that can be high.

So once you’ve noticed that you have quite a few error_logs and that you have solved the issue causing the errors, this one line of code via a SSH terminal can delete all the logs for you.

find . -name error_log -exec rm -f {} \;

As a warning this won’t prompt you to delete the files and a typo could result in you losing everything.

Leave a Reply

Your email address will not be published.

Human test: Enter Ryan backwards