What an inode is
Updated November 1, 2026
An inode is the record of a file: its data, size, owner, permissions and times. The file's name is not in the inode: the name sits in a directory and points at the inode number.
ls -i file # the inode number
stat file # inode, size, permissions, links, times
df -i . # free inodes on the filesystemSample output
$ ls -i original.txt
2361930 original.txt
$ stat original.txt
File: original.txt
Size: 12 Blocks: 8 IO Block: 4096 regular file
Device: 0,148 Inode: 2361930 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ student) Gid: ( 1000/ student)
Access: 2026-07-26 04:04:25.004225033 +0000
Modify: 2026-07-26 04:04:25.004997494 +0000
Change: 2026-07-26 04:04:25.004997494 +0000
Birth: 2026-07-26 04:04:25.004225033 +0000A filesystem has a finite number of inodes. A million tiny files can exhaust the inodes even with disk space left - then df -i shows 100% inodes while df -h is fine.
Common mistakes
An editor does not change a file in place. It writes a new file and renames it over the old one, so the inode changes. Run ln a.txt b.txt and both names show inode 2270842 with a link count of 2. After sed -i 's/one/two/' a.txt the name a.txt points at inode 2270843 with a count of 1, while b.txt still holds the old inode and the old bytes: cat a.txt prints two, cat b.txt prints one. The two names came apart and you deleted nothing.
cp always makes a new inode; mv inside one filesystem only moves the name. src.txt has inode 2270844: after cp src.txt copy.txt the copy got 2270845, after mv src.txt moved.txt the number stayed 2270844. Across filesystems mv is a copy plus a delete: inode 2303699 became inode 3 after mv f.txt /dev/shm/moved.txt. Compare files with the pair stat -c '%d %i' file: the first number is the device, the second is the inode, and a matching inode number on two devices means nothing.
ls -i on a symbolic link prints the link's own inode, not the target's. For s.txt -> t.txt, ls -i s.txt gives 2303701 while stat -Lc '%i' s.txt gives 2303700, the inode of t.txt. So find . -inum 2303700 will not list s.txt, and ls -i on a link tells you nothing about where it points.
Used in
You need this in the lesson Inodes and links.