Reading inode information and learning the filesystem
Understanding inodes is the key to understanding the filesystem in Linux at a deeper level. A filename isn't the actual file in a Linux or Unix system. It's just a pointer to an inode. The inode has information about where the actual data is stored and a lot of meta data about the file, such as the file mode, last modification date, and owner.
In this recipe, we'll get a general understanding of the filesystem and how inodes fit into this. We will also view inode information and learn a few commands for that. We will also write a small C program that reads inode information from a filename.
Getting ready
In this recipe, we'll use both commands and C programs to explore the concepts of inodes. Everything you need for this recipe is covered in the Technical requirements section of this chapter.
How to do it…
In this recipe, we'll begin by exploring the commands that already exist on the...