Free up space on WHM / cPanel server

There are two things that take up a substantial amount of space on a WHM server if not carefully managed:

  1. Files contained in account trash folders
  2. Incomplete / temporary cPanel uploads

To remove all files contained in account trash folders login to your WHM server via SSH and issue the following commands:

rm -rfv /home/*/.trash/*

To remove all incomplete / temporary cPanel uploads issue the following command:

rm -fv /home/*/tmp/Cpanel_*

A command I found particularly useful in find large files on the server is the following:

find /home -type f -size +200000k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }'

This command finds files >= 200 Mb