An inode (index node) is a data structure found in many Unix file systems. Each inode stores all the information about a file system object (file, device node, socket, pipe, etc.), except data content and file name.
Each file is associated with an inode, which is identified by an integer number, often referred to as an i-number or inode number. Inodes store the following information about files and directories (folders):
Inode number
Mode information to discern file type
Number of links to the file
UID of the owner
Group ID (GID) of the owner
Size of the file
Actual number of blocks that the file uses
Time last modified
Time last accessed
Time last changed
On many types of file system implementations, the maximum number of inodes is fixed at file system creation, limiting the maximum number of files the file system can hold. A typical allocation heuristic for inodes in a file system is one percent of total size. The inode usage can typically be found by running du -hi
.
The inode number indexes a table of inodes in a known location on the device; from the inode number, the file system driver portion of the kernel can access the contents of the inode, including the location of the file allowing access to the file.
A file's inode number can be found using the ls -i
command. The ls -i
command prints the i-node number in the first column of the report.
Further Reading: