How to delete “some file” files from all accounts

Let’s use the error log for this example but you can substitute any file.

The error_log file saves the error logs of a account / user / website. There can be multiple error_log file under one user / account / website.

These error_log files may consume lots of space on your server. Sometimes the size of error_log files are in GB. So, you may want to delete all error_log files to free up some space on server.

Login in server via SSH as root and execute following command:

find /home -type f -name error_log -exec rm -f {} \;

The above command will search for error_log files in /home directory and delete them. Thus it will delete all error_log files under all users / accounts / cPanel accounts / websites.


1) This command can take lots of time to complete depending on size of your /home directory. Sometimes it may take 10-30 minutes to complete.

2) When required the server will automatically create new error_log files.

Related Post

Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/idcthail/public_html/wp-includes/functions.php on line 3728