Command for finding disk usage of error_logs in the home directory

It’s really a headache while handling disk space issues with the Linux server. Today I am sharing one of the easiest commands to sort out the size of unwanted logs that can be easily removed from the server to tackle the disk space issue.

For cPanel servers:

root@arunlal [~]# find /home -type f -name error_log -exec du -h {} + | sort -h | tail

11M /home/arun/public_html/error_log
18M /home/firdos/public_html/error_log
31M /home/teddy/public_html/error_log
61M /home/peter/public_html/error_log
62M /home/denny/public_html/error_log
88M /home/evette/public_html/error_log
91M /home/vibin/public_html/error_log
124M /home/virtfs/math/var/log/apache2/error_log
269M /home/virtfs/math/usr/local/cpanel/logs/error_log
286M /home/virtfs/math/usr/local/apache.ea3/logs/error_log

For Plesk servers:

root@arunlal [~]# find /var/www/vhosts -type f -name error_log -exec du -h {} + | sort -h | tail

3.6M /var/www/vhosts/system/xxxx.com/logs/error_log
6.6M /var/www/vhosts/yyyyy.com.bak/statistics/logs/error_log
7.5M /var/www/vhosts/system_BEFORE_UPGRADE/zzzzzz.com/logs/error_log
8.6M /var/www/vhosts/system/rrrrr.com/logs/error_log

Post navigation

Leave a Reply