Inodes:

As we know that each and every file  in a Unix OS consist of a number by which it is uniquely identify by its file system. Such number is known as inode number or information node number.
In Unix file system the disk space is allocated in terms of blocks. These blocks are

1.    Boot Block : Contains the boot step program.
2.   Super block: Contains the information about the file system.
3.  Data Block: Data block are allocated blocks in a file system that contains the actual file contents.
4.    Inode table block: The inode table contain the basic information about the file

This table is accessed with the help of inode number. The inode number for a file is unique in a single file system. The basic information about a file in the node table is accessed with the help of inode number. If there are 10 files in the directory, then there are 1 inode number for each file. The inode table contains information like:

1.    Owner of the file
2.    Size of the file in bytes
3.    Last access date
4.    File creation/ deletion time
5.    Number of links
6.    Access control list
7.    The user and group ID of the file system
8.    Type of file (ordinary, directory or special)
9.    File protection bits.
10.    Address of the block where the file is physically exist and many more

The entry of a file in inode table is changed when the owner, group or permission are changed. The most important thing about the inode table is that it does not contain the name of the file and its contents.

Moreover, you can find out the inode number of a file by using the “- i “ option of “ls” command. Suppose I have a file called “punit”. I want to find out the number of this file. E.g

$ ls –i punit
22645 punit
$

Here 22645 is the inode number of the file “punit”.

Moreover, the changing the name of the file does not change the inode number and if you move this file to any another user defined directory even then the inode number would remain the same.       

 


Like it on Facebook, Tweet it or share this article on other bookmarking websites.

No comments