Counting your inodes: how many files you have and which folders hold the most

cPanel & WHM·· 34 views· 6 min read

The short answer: the total is in the cPanel Statistics sidebar, on the File Usage line (in some versions, Inodes), with the limit beside it. To find out which folders hold the most files, the Disk Usage screen will not help, because it shows weight, not count: use the cPanel Terminal with the du --inodes command, which only reads and counts. In most accounts the answer sits in three places: e-mail (every message is a file), the site cache and image thumbnails. What an inode is: the limits nobody advertises; how to cut the count: too many inodes.

Where to see each thing

What you want to know Where to look What you will see
How many files you have, and the limit cPanel, the Statistics sidebar, the File Usage line The number of files and folders, the limit and the percentage.
How close to the limit, outside cPanel The service page in My MozOut, or the link in the warning e-mail The usage bar, Upgrade and Check now.
Which folders hold the most files The cPanel Terminal (Advanced section) or SSH The count per folder, with the commands below.
Which mailbox has the most messages The Terminal, inside the mail folder; or each mailbox’s webmail The count per mailbox; in webmail, the number of messages in each folder.
How many files one folder has, without Terminal The File Manager Only one folder’s list at a time: good for confirming, not for searching.

cPanel menu names change slightly with the version and the panel language: look for the meaning, and type the name into the cPanel search box if you cannot spot it.

Counting the files, step by step

1 See the total. In cPanel, the Statistics sidebar, File Usage line. Write down the number and the percentage.
2 Open the cPanel Terminal (the cPanel Terminal). It opens in the account’s home folder, already signed in as your user.
3 Count per account folder: the second command below lists the account’s folders with the number of files in each, smallest to largest. The last line is the total; the one above it is the culprit.
4 If the biggest is mail, the third command shows the mailboxes with the most messages (the folders of each domain and each mailbox).
5 If the biggest is public_html, the fourth command goes three levels down and shows the site folders with the most files. On WordPress, look for wp-content/cache and wp-content/uploads.
6 Repeat inside the folder with the biggest number (change the path in the command) until you reach the folder that explains the total.
7 After cutting it down, go back to Statistics or use Check now in My MozOut. The count can take a little while to update.

du -s --inodes ~
du --inodes -d 1 ~ | sort -n | tail -15
du --inodes -d 2 ~/mail | sort -n | tail -10
du --inodes -d 3 ~/public_html | sort -n | tail -20

On the service page in My MozOut (Services, the service), once usage passes 75% a banner appears with the usage and a See the account usage button. It opens a page with the usage bar, Upgrade and Check now. The link in our warning e-mails opens that same page.

How to read what you found

Folder with many files What it usually is Is it normal?
mail Messages: each one is a file, Trash, Spam and Sent included. Yes, but years of Trash and Spam are not. Your mailbox is full.
wp-content/cache, or the caching plugin’s folder A copy of each page, sometimes several per page. Only if it expires. A cache that is never cleared grows without end: LiteSpeed Cache: the first settings.
wp-content/uploads Images and the thumbnails WordPress makes in several sizes. Yes. It grows with the site; do not delete it by hand.
node_modules, .git A project’s dependencies and history. They rarely need to be on the server.
tmp or a sessions folder An application’s temporary files. Only if the application clears them. If they grow every day, it is the application.
.trash What you deleted in the File Manager. No: it still counts. Empty it.
Backup folders or unpacked old sites Forgotten copies, file by file. No. Compress, download and delete.

The Terminal and Statistics figures may not match exactly: they measure at different times, and du also counts folders. To find the culprit folder, the difference does not matter.

Optimise or upgrade?

Situation Optimise or upgrade?
The biggest folder is cache, trash, backups or an old site Optimise. Clearing it with the tool that created the files fixes it.
The biggest folder is e-mail, with years of messages Optimise first: empty and archive elsewhere. If the team needs it all on the server, upgrade.
The biggest folder is the uploads of a growing shop or gallery Upgrade. Those are files the site uses.
The total passes 85% again weeks after cleaning up Upgrade.

Bigger plans

Plan Files (inodes)
Pro 200,000
Plus 400,000
Ultra 600,000
Business Pro 1 million
Business Plus 1.5 million
Business Ultra 2 million

The file limit goes from 200,000 on Pro to 2 million on Business Ultra (table above), and the Business line suits shops and sites with many products and photos. Your account’s limit is on the File Usage line in Statistics; after the upgrade, the new limit appears on the same line. How to do it: how to upgrade your plan; which step to pick: which hosting plan comes next.

The commands in this article only count. Do not add delete commands copied from elsewhere: one wrong path takes the site or the mail with it. To cut the count, use the tool that created the files (the caching plugin, webmail, WordPress), and take a copy first: making a full cPanel backup.
Keep today’s count to compare. Copy the output of the second command into a text file on your computer. In a month, run it again: the folder that grew most between the two lists is the one that deserves attention.

Counted and still cannot see where so many files come from? Open a support ticket with the output of the second command.

Open a support ticket

SEE ALSO

The limits nobody advertises: inodes, processes and memory

Too many inodes: cutting the number of files in your account without breaking it

The cPanel Terminal: a command line with nothing to install

Your plan limits at a glance: where to see each one in cPanel and in your account

Your mailbox is full: what to delete and how to stop it happening

How to upgrade or downgrade your plan

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.