linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
  • Введение
  • Уроки
  • How it works
  • Симулятор
  • База знаний
  • Собеседование
Lessons
Footer
linuxlab-TutorialsPricingAboutPrivacy & cookies
Copyright © 2026 LinuxLab. All rights reserved.
Beginner · урок 04·~12 мин
пропустить →
About

Inodes and links: a file name is not the file

In Linux a file and a file name are two different things.

  • An inode is the internal record number in the file system. It holds the metadata (permissions, owner, size, time) and the pointers to the data blocks.
  • A file name is an entry in a directory that references an inode. The same inode can have several names (that is a hard-link), or a completely different inode can be a "shortcut" pointer to a path (that is a symbolic-link).

Understanding this saves hours of debugging: it explains why du and df disagree, why a deleted file does not free up space, and why a backup doubles in size.

Если уже знаком с темой, пропустить введение и сразу к терминалу.

What you'll learn

Что узнаешь

Ключевые идеи урока. Каждая разбирается на отдельном шаге с проверкой.

  • ┌A file name ≠ a file. A name is a directory entry, a file is an inode
  • ├Hard link: one inode under two names; rm decreases the link count
  • ├Symlink: a separate "shortcut" file, can point to nowhere
  • └Inodes and space are two independent resources; you have to monitor both
Commands

Команды, которые встретятся

Не нужно их заучивать заранее, запомнятся по ходу. Беглый взгляд сейчас сделает урок легче.

командачто делает
stat <file>the file's card: inode, links, size, time
ls -lilong listing with inode numbers
ln <src> <dst>hard link: a second name for the same inode
ln -s <path> <name>symlink: a small file with a path inside
readlink <symlink>print the path a symlink points to
df -i <fs>free inodes (NOT free space)
Knowledge base

База знаний по теме

Короткие справочные статьи. Не главы, не нужно читать перед уроком. Удобно открывать после, чтобы закрепить термин.

/kb/hard-link

Hard link in the KB

/kb/bind-mount

Bind mount as an alternative

готов?

Sandbox запустится автоматически, подожди 5–10 секунд после клика.

Начать урок →