Inodes, hard links & symlinks
A filename is not the file. It is a directory entry pointing at one.
Before you start
A filename is not a file. On Linux, a filename is an entry in a directory that points at an **inode** — a numbered record that carries the actual metadata (size, permissions, owner) and the addresses of the file's data blocks.
This split is why one file can have many names (**hard links**), why deleting a filename does not always free the data, and why mv inside a filesystem is nearly free — nothing is copied, just directory entries changed.
This lesson visualises the inode behind a file, adds a second hard link, adds a symlink, and shows what "deletion" actually does.
Directory: /home/ana
a directory is a list of name → inode pairs| Row | name | inode |
|---|---|---|
| notes.txt | 4218 |
Inode table
the file itself — metadata and where the data livesOne name, one inode, link count 1.
Step 1 of 6. The file is the inode, not the name. An inode holds everything about a file except its name: permissions, owner, size, timestamps, and pointers to the data blocks on disk. A directory is simply a table mapping names to inode numbers. `ls -li` prints that number.
Step 01 / 06
The file is the inode, not the name
An inode holds everything about a file except its name: permissions, owner, size, timestamps, and pointers to the data blocks on disk.
A directory is simply a table mapping names to inode numbers. ls -li prints that number.
ls -li notes.txt # -i shows the inode numberln notes.txt hard.txt # hard link: a second nameln -s notes.txt soft.txt # symlink: a file containing a pathrm notes.txt # hard.txt still works, soft.txt breaksdf -i # inodes can run out before disk space does