Skip to main content

Command Palette

Search for a command to run...

"Yeah Linux, What’s an Inode?" — A Fun Guide to Inodes, Hard Links & Soft Links

Updated
3 min read

Ever deleted a file and it’s still there somehow? Welcome to the Matrix, buddy.
Today we’re breaking down Linux file systems in the most human (and meme-worthy) way possible. Buckle up.

Meet Mr. Inode

Imagine you’re in a library. Every book has:

  • A label on the shelf (name)

  • An ID card inside (details about the book)

In Linux, that ID card = inode.

Inode holds:

  • Who owns the file

  • File size, type

  • Permissions

  • Timestamps

  • Where the real data is stored

But NOT the filename!
Filename is like the label on the shelf. You can change it, but the book stays the same.

Okay, imagine you clone the label on the shelf. Now two names point to the same book.

bashCopyEditln story.txt evil_twin.txt

Now both story.txt and evil_twin.txt are equal twins.

  • Same data

  • Same inode

  • You delete one? No worries, the other lives on. Like Voldemort's Horcrux 💀

Check this:

bashCopyEditls -li story.txt evil_twin.txt

Same inode. Twins confirmed.


This one’s like a Post-it note that says “Yo, look at that other book.”

bashCopyEditln -s story.txt shortcut.txt

Now shortcut.txt is a soft link:

  • It’s a file that points to another filename.

  • Different inode

  • If story.txt disappears, shortcut.txt is broken 😢

🧪 Try this:

bashCopyEditrm story.txt
cat shortcut.txt
# Error: No such file

Like a YouTube video deleted by the uploader.


FeatureHard LinkSoft Link
Inode shared?YesNo
Points toThe actual file (inode)The filename
Survives file delete?YesNo (breaks)
Cross-filesystem?NopeYup
Directory-friendly?Not allowed (mostly)Yes

Real-World Playground

bashCopyEditecho "Wassup Linux" > a.txt
ln a.txt bro.txt        # hard link
ln -s a.txt shortcut.txt  # soft link

ls -li a.txt bro.txt shortcut.txt

rm a.txt

cat bro.txt       #  still works
cat shortcut.txt  #  broken

TL;DR — For Lazy Coders

  • Inode = file’s internal ID card, holds metadata (not the name).

  • Hard Link = another name for the same file.

  • Soft Link = shortcut that points to a filename.

  • Hard links are tough like Vin Diesel. Soft links are fragile like your ex's promises.


Outro

Next time someone says “I deleted the file but it's still there,”
you say: “Bro, that’s just an inode with more fans.”

If this blog made you smile and learn, share it with your DevOps/tech homies, your junior Linux pals, and even your .. if .. likes terminals.

Peace out .. Mic Drop
#Linux #DevOps #LinksNotDrinks #LearnWithMemes


LINUX-BUILD-FOR-REAL

Part 2 of 5

Linux isn't just a kernel — it's a playground for anyone serious about TECH. In this series, we cut through the noise and focus on the commands, tools, actually show up in the real world — just clean, focused lessons with a bit of flavor.

Up next

“Linux Directories: Cracking the Code of /, /bin, /sbin, ..”

Ever peeked into a Linux system and felt like you stumbled into a mysterious hacker’s closet full of folders you’re not supposed to touch?Yeah… I definitely did, once upon a time.Let’s open those doors together — and maybe laugh along the way." Welc...

More from this blog

KRIS-DEV-LEARN

9 posts