| Many aspects of Linux functionality are found, | | | | something else. The file access permissions |
| perhaps in a somewhat different form in | | | | denote the permissions, also discussed in a |
| Windows. Inodes, the subject of this article, are | | | | previous article. A given file may have different |
| truly absent from the Windows bag of tricks. | | | | permissions for different users, for example |
| Given the practicality of inodes, Windows now | | | | accounting users may have permission to read |
| contains an imitation of this functionality. But really, | | | | and modify the file while marketing users only |
| to take full advantage of this somewhat | | | | have permission to read it. |
| complicated concept, you'll have to go to Linux or | | | | File access information specifies when the file was |
| Unix. | | | | last accessed, last modified, and when the |
| So what are inodes and why would anyone want | | | | associated inode was last modified. The number |
| to use them? Inodes are the internal description | | | | of links indicates the number of names that the |
| of a file. As we will see below, the specific inode | | | | file has. In our example, the file has two links. If |
| contents for a given file are different in memory | | | | either accounting or marketing delete the file |
| and on disk. But the key to the inode is that a | | | | (assuming that they have such permission) the |
| single file may have different names. Why would | | | | number of links is reduced to 1. But the file is still |
| anybody want to do that? One of the most | | | | there and the number of links could be increased. |
| important reasons is that a user may access a | | | | The inode on disk provides a list of data |
| shared file by an intuitive name. Users from the | | | | addresses; the single file may be scattered across |
| accounting department could call a certain file with | | | | the disk. The final value is the size of the file in |
| an accounting-style name, while users from the | | | | bytes. |
| marketing department could access this same file | | | | The inode in memory contains all of the above |
| by a name that makes sense to them. This | | | | information plus additional information such as |
| functionality alone makes inodes worth having. | | | | whether or not the file is available for processing |
| Furthermore, let's say that by accident the | | | | (someone else may be using it) and whether |
| "accounting" file was deleted. Accounting users | | | | someone is waiting to process the file. |
| could still access that file if they knew the | | | | Remember, several people may be using Unix or |
| "marketing" name. Remember, we are talking | | | | Linux. If there were no file usage control two |
| about the very same file even though it has | | | | different people in accounting could pay a bill at |
| different names. People don't have to know about | | | | the same time. Windows doesn't have this |
| these complications to be able to access the file. | | | | problem; it's not a multi-user system. |
| The extra processing is handled behind the | | | | The ln command is used to create a link to a |
| scenes. | | | | given file. For example, ln acct1 mark1 links the |
| Now let's take a closer look at inodes. The inode | | | | mark1 file to the acct1 file, in other words makes |
| on disk contains the following information: file | | | | the name mark1 available for the acct1 file. It's |
| owner identifier, file type, file access permissions, | | | | the same file, but with a new name. The ls -i |
| file access information, number of links, list of | | | | command provides information about the file |
| data addresses, and file size. The file owner | | | | including the number of links (the number of |
| identifier specifies the file owner and the group | | | | names for the file.) |
| owner as discussed in our article on permissions | | | | The next article in this series discusses the Linux |
| and groups. The file type indicates whether we | | | | kernel and processes. |
| are talking about a regular file, a directory, or | | | | |