Imagine This:
Think of a file as a book in a library.
Now imagine two parts:
📦 What is an Inode?
An inode is like a secret record that your Linux system keeps about each file.
It does NOT store the file's name.
Instead, the inode stores:
Who owns the file
When it was created or changed
What permissions it has (read/write etc.)
Where the actual content of the file is stored on disk
How big the file is
So:
✅ Inode = All info about the file, except the name
🎯 Why Do We Need Inodes?
Linux doesn't look up files by name directly.
Instead:
It sees the name of the file in a folder (just like a label).
That name points to an inode number.
Linux then uses that inode number to find the file's actual content and metadata.
✅ Simple Example:
Imagine you create a file:
echo "hello" > greeting.txt
Linux does this:
Adds an entry in the folder: greeting.txt → inode 12345
In inode 12345, it stores:
Size: 6 bytes
Owner: you
Data location: where "hello\n" is stored on disk
Permissions: read/write
Timestamps: created now
📂 Then, You Create a Hard Link:
ln greeting.txt copy.txt
Now your folder has:
greeting.txt → inode 12345
copy.txt → inode 12345
Both names point to the same file!
If you edit one, the other changes too — because they are the same content, just with two names.
❌ But If You Delete One?
rm greeting.txt
Still OK!
copy.txt still points to inode 12345.
The file still exists because one pointer (hard link) is alive.
⚠️ But a Symlink (soft link) Is Different:
ln -s greeting.txt link.txt
This is like a shortcut that says:
“Look for a file named greeting.txt.”
If greeting.txt is deleted, the symlink (link.txt) is broken.
🛠 Why You Should Care (In Real Jobs):
📌 Key Line to Remember:
“A filename is just a label. The actual file lives in the inode.”
What is an Inode? (Explained in Lehman's Terms)
Think of your Linux file system like a giant library.
Each file is like a book.
The name of the book (e.g., notes.txt) is stored in a directory — like the library catalog.
But the actual book (pages, content, metadata) lives on a different shelf.
An inode is like the index card that stores all details about the book except the name.
🗂️ Inode = File Metadata Holder (But Not the Filename)
When a file is created, the file system assigns it a unique inode number (just like a library card ID). That inode stores:
📌 The filename is NOT stored in the inode — only in the directory that maps the name to the inode.
🛠️ Real-World Use Cases of Inodes
🔍 How to View Inode Info
# See inode of a file
ls -li file.txt
# Find all files with same inode (hard links)
find . -inum 123456
# Show inode count and free inodes
df -i
🎯 Why Should You Know About Inodes?
📦 Summary in One Line:
“An inode is the metadata container of a file, minus the filename. It’s the heart of how Linux tracks files under the hood.”
Ref: https://tecadmin.net/what-is-soft-links-and-hard-links-in-linux/