What Is An Inode - Linux Hint
Maybe your like
Working With inodes in Linux
Inodes in Linux are entries that form the basis of file systems in Linux. They manage and handle metadata about files and facilitate the inner working of files in Linux. File systems in Linux have two sections; the inodes and data blocks.
Inodes act as data structures, defining directories and files on the Linux file system. Moreover, they get stored in the directory entry. An inode contains all data needed to read files and point to blocks that make up files. Therefore, programs that refer to files by their name look up the corresponding inode from the directory entry file.
All files in Linux directories contain an inode number and the filename, and using the inode number; one can retrieve the file’s metadata. However, the inode numbers and file names get stored in a separate index but link to the inodes.
An inode contains different information, including:
- File permissions
- File size
- Group and User IDs of a file
- Timestamps for creating, reading, and writing a file.
- Location of the data
- Hard and soft links
- File types
Checking inode Numbers
You can check the number of inodes in a file system or even for a specific file. To check for a file system, use the command below.
$ df -ihIn the output below, you can note the specific file system and its different statistics, including free and used percentages.

Alternatively, you can specify a specific file system to check. For instance, to check for /sda5, we can use the command below.
$ df -ih /dev/sda5
To check the inode number for a specific file, you can list its contents using the ls -il or stat command. The stat command displays the statistics of a given file, such as the inode number. For our example, our file is test.txt, and our command is shown below.
$ stat test.txtOther file details, such as the creation date, get displayed with the stat command.

Similarly, listing the contents of the current directory displays the number of blocks of a specific file.
$ ls -li | grep test.txt
For this case, the inode number is 4983306.
To check the directory-level inode, add the -d flag to the command of checking the inode of files.
The new command will be:
$ ls -ldi ~/Desktop
Having a count of the inode usage is beneficial as excessive inode usage is problematic and can hinder creating newer files even when there is available space on the file system. To maintain a low inode usage, use the tricks listed below.
- Clear or delete cache files
- Delete old email files
- Remove unneeded directories and files
- Delete temporary files
Doing so ensures you don’t run out of inodes and have enough room to create more files. Some effects of running out of inodes vary, but the common ones include:
- Processes not restarting
- Periodic tasks not loading
- Crashing of applications
- Data loss
- Unable to create files or directories.
When you start seeing such signs, check the number of inodes and try the above tips to maintain low inode usage.
Wrap Up
Understanding inodes when working with Linux file systems is essential. We’ve covered the concepts and commands you should know when working with inodes in Linux. Understanding inodes give you an upper hand when examining file systems and maintaining low inode usage. Hopefully, this article covered all you need to know about inodes in Linux.
Tag » What Is An Inode In Linux
-
Inodes And The Linux Filesystem | Enable Sysadmin - Red Hat
-
What Are Inodes In Linux? - - Rackspace
-
Inode - Wikipedia
-
Inode | Linux# - Geek University
-
Everything You Ever Wanted To Know About Inodes On Linux
-
Linux Inodes - Javatpoint
-
What Is An Inode And What Are They Used For? - Blue Matador
-
What Is Inode Usage, And How Can We Reduce It - Linux - Site24x7
-
What Are Inodes In Linux And How Are They Used? - Help Desk Geek
-
Inodes In Linux: Limit, Usage And Helpful Commands - Stackscale
-
What Is Inode Number In Linux? - TecAdmin
-
Inodes: A Starting Point For Understanding Linux Filesystems - Medium
-
What Is Inode In Linux - By Heshan Dharmasena - Medium
-
Archived | It Is All About The Inode - IBM Developer