Sometimes you end up with a ton of files in a directory, so many files that it is difficult to delete them. (I did this with some file caching code that was not working as well as I thought.) Just trying to change directory to where all those files are hangs the FTP software. Try to delete them via SSH and you cannot because of too many files.

Fortunately, cPanel’s File Manager does the job. Log into cPanel and click the File Manager icon. Navigate to the correct directory (aka, folder) by clicking the little yellow folder icons. Do not open (go to) the directory with all the files. Simply select it by clicking the filename. In the upper right of the screen, you will see a list of operations. The first is “Delete this folder and all files under it.” Click it.

A little lower on the right, you will see a trashcan icon. Click the trashcan to empty the trash (delete the directory and all the files). Be sure you are deleting what you intend to because there is no yes / no option.

If you want the directory you just deleted, create it again using your preferred means (SSH, FTP, cPanel). Note that if the directory required special permissions, remember to do so. Although you are re-creating the directory, the overall process was much faster than other means I tried.

Popular Posts