CS FundamentalsVery hardGATE CS

In a traditional Unix file system (such as ext2/ext4 without very large directories), directory /d contains 3 subdirectories and 5 regular files. What is the hard-link count of /d?

  1. A. 5
  2. B. 2
  3. C. 8
  4. D. 10

Correct answer: A. 5

A directory is linked from its parent's entry and from its own '.', which gives 2, and each subdirectory's '..' adds one: 2 + 3 = 5. Regular files inside do not add links to the directory.

More Operating Systems questions

Exams that ask this topic