As you know, everything is a file in Linux.
Each and every files (It includes all kind of files) and folders/directory called inode.
Each file or directory adds 1 to the inode count.
In this article, we will show you, how to check inode and its count.
Also, we will tell you, how to count for specific user.
What Is Inode?
The inode stands for index node or index number is a data structure in a Linux file system that stores information about a file and directory.
File systems in general have two parts, those are metadata and actual data.
Each file has an inode containing metadata about the file. Each file in a filesystem has a unique inode number. Inode numbers are guaranteed to be unique only within a filesystem.
You may get the following error when inode is full on the file system. No space left on device or running out of Inodes.
Inode stores the following information about a file.
- Size of the file.
- Device ID
- User ID (UID)
- Group ID (GID)
- Information about permissions (read, write, execute, etc)
- File access privileges (owner, group and others)
- Time stamps information such as file access, file modification, file deletion and inode number change.
- Information about soft links and hard links
- Location of the file on the file system
How To Check Inode Number Of The File In Linux?
Use the ls command with
-i option to view the file inode number. The inode number of the file will be shown in the first field of the output.
How To Search A File Using Inode Number In Linux?
You can able to find the files using inode number in Linux. To do so, use the following format.
How To Check Inode Utilization On The File System In Linux?
If you would like to check inode utilization on the file system then run the following command.
How To Count Inode Usage In Linux?
If you would like to count inode utilization in the current directory, use the following command. This will print the output without grand total.
How To Count Inode Usage In Linux With Grand Total?
If you would like to count inode utilization in the current directory, use the following command. This will print the output with grand total.
How To Check Inode Changes With Copy And Move?
Inode values doesn’t get change/modify when you perform the file move with in the file system. See the results below.
Inode values get changed/modified when you perform the file copy in Linux. See the results below.
How To Reduce The Inode Usage In Linux?
The only option is to delete the unused files to reduce the inode usage in Linux.
Bonus Tips For Website Owners
Most of the hosting providers were offering the Shared UNLIMITED hosting.
Is it true? No it’s not true because there is no UNLIMITED hard disk then how can its possible?
Every web hosters were provide some Terms & condition for INODE limits so, have a look on it before you buy the hosting.
If the shared hosting is not suitable for you then try Virtual Private Server (VPS) or Dedicated Server (DS) because there is no limit for inode usage.