Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

Directory structures

Five organisations side by side, with a quiz.

Module 4 Session 4.8 Lesson 1 of 2

Directory structures

Five organisations, from one flat list to graphs with links.

StructureSame name for two users?GroupingSharingMain issue
Single-levelNoNoTrivialNaming collisions
Two-levelYesNoHardIsolation between users
TreeYesYesVia paths onlyNo shared subdirectories
Acyclic graphYesYesLinksAliases, deletion (reference counts)
General graphYesYesAny linksCycles: garbage collection
Links on Linux
$ echo hello > a.txt
$ ln a.txt hard.txt        # hard link: same inode, link count 2
$ ln -s a.txt soft.txt     # symbolic link: a small file containing the path
$ ls -li
1311 -rw-r--r-- 2 student student 6 a.txt
1311 -rw-r--r-- 2 student student 6 hard.txt
1312 lrwxrwxrwx 1 student student 5 soft.txt -> a.txt
$ rm a.txt                 # hard.txt still works; soft.txt now dangles
Quick check

Which structure first allows grouping of a user's files into folders?

Subdirectories appear with the tree structure.

After deleting the original, a symbolic link…

It only stores a path name.

Why do general graphs need garbage collection?

A self-referencing directory never reaches count 0.