Linux InodesAn Inode number is a uniquely existing number for all the files in Linux and all Unix type systems. When a file is created on a system, a file name and Inode number is assigned to it. Generally, to access a file, a user uses the file name but internally file name is first mapped with respective Inode number stored in a table. Note: Inode doesn't contain the file name. Reason for this is to maintain hard-links for the files. When all the other information is separated from the file name then only we can have various file names pointing to the same Inode. Inode ContentsAn Inode is a data structure containing metadata about the files. Following contents are stored in the Inode from a file:
Example: Look at the above snapshot, it shows some of the Inode contents. Inode TableThe Inode table contains all the Inodes and is created when file system is created. The df -i command can be used to check how many inodes are free and left unused in the filesystem. Look at the above snapshot, the command "df -i" shows the usage of several file systems. Inode NumberEach Inode has a unique number and Inode number can be seen with the help of ls -li command. Look at the above snapshot, Directory Disk1 has the three files and each file has a different Inode number. Note: The Inode doesn't contain file content, instead it has a pointer to that data.
Next TopicLinux Directories
|