Files do not actually reside inside directories. A directory is a file that contains references to other files. The directory holds two pieces of information about each file:
- its filename. - an inode number which acts as a pointer to where the system can find the information it needs about this file.
Filenames are only used by the system to locate a file and its corresponding inode number. This correspondence is called a link.
To the system, the file is the inode number. Multiple filenames can be used to refer to the same file by creating a link between an inode and each of the filenames.