Linux directory layout: location of device files Which standard directory contains device files represented as special files in Unix/Linux?

Difficulty: Easy

Correct Answer: /dev

Explanation:


Introduction / Context:
Understanding the Filesystem Hierarchy Standard (FHS) is essential for Linux system administration. Device files are not typical data files; they are special files that provide an interface to hardware and kernel drivers. Knowing where they reside is foundational knowledge for troubleshooting and configuration.



Given Data / Assumptions:

  • The system resembles a standard Unix/Linux distribution following common FHS conventions.
  • We need the directory that holds character and block device special files.
  • We are not considering containerized or highly specialized minimal systems that virtualize device access elsewhere.


Concept / Approach:

Device files traditionally live under /dev. Entries like /dev/sda (block device), /dev/tty (character device), and many others map to hardware or virtual devices via the kernel. udev and related subsystems populate /dev dynamically at runtime, but the conventional path remains the same across distributions.



Step-by-Step Solution:

Identify the purpose: device special files.Recall FHS mapping: binaries in /bin, configuration in /etc, users in /home, devices in /dev.Select /dev as the correct directory.Verify by listing devices: ls -l /dev to see character (c) and block (b) devices.


Verification / Alternative check:

Run ls -l /dev and observe entries like /dev/null, /dev/zero, and storage devices. Compare with /bin (user binaries), /etc (configuration), and /home (user home directories) to confirm their distinct roles.



Why Other Options Are Wrong:

  • /bin: contains essential user binaries, not device nodes.
  • /etc: contains system-wide configuration files.
  • /home: contains user home directories.
  • None of the above: incorrect because /dev is correct and standard.


Common Pitfalls:

Confusing /dev device nodes with mount points under /media or /mnt; assuming device files contain data like regular files; forgetting that permissions and ownership on /dev entries matter for access control.


Final Answer:

/dev

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion