Great question! While the standard df command reports on disk space usage (bytes, megabytes, gigabytes), the -i option reports on inode usage.
What is an Inode?
In Linux, every file and directory is assigned an "inode." Think of an inode as a unique ID card for a file that contains information about it (like who owns it and where it's located on the disk).
The important thing is: A disk has a fixed number of inodes. Even if you have plenty of GBs of space left, if you run out of inodes (because you have millions of tiny files), you cannot create any new files!
How to use it:
Run the following command in your terminal:
df -i
What the output means:
Instead of showing sizes in blocks or GB, you will see:
- Inodes: The total number of inodes available on the filesystem.
- IUsed: The number of inodes currently being used (one for each file/folder).
- IFree: The number of inodes still available.
- IUse%: The percentage of inodes used.
Why is this useful?
If you ever get an error saying "No space left on device" but when you run df -h it shows you still have plenty of Gigabytes available, you should check df -i. You might have run out of inodes!
Keep exploring! Understanding the difference between disk space and inodes is a big step in Linux mastery.