Inodes
In short: An inode is a file’s management record in Unix file systems. It stores everything about the file except its name and its content.
In more detail: The inode holds size, owner, permissions, timestamps and the addresses of the data blocks. The file name, by contrast, lives in the directory, which is just a list of “name → inode number”.
In Depth
- Hard link: Several names point to the same inode. The file disappears only when the last name and all open accesses are gone.
- Rename/move: Within the same file system only the directory entry changes; the data stays untouched.
- Out of inodes: A file system has a fixed number of inodes. Millions of tiny files can exhaust them even though space is free (
df -i). - Viewing:
ls -ishows the inode number,stat fileall metadata.
See also: Symbolic links and hard links