CompTIA Linux+ (XK0-004) — Question 221

A new IO card has been added to the security server to log the opening and closing of the main entrance. A switch is attached, so the interface card returns a 1 when the door is opened and a 0 when the door is closed.
Which of the following describes the Linux device to which this switch is attached?

Answer options

Correct answer: B

Explanation

The correct answer is /dev/port, which is used for direct access to hardware ports, including switches. The other options do not accurately represent a device that would handle the direct input from a hardware switch; /dev/tty0 is for terminal devices, /dev/gpio is for general-purpose input/output, and /dev/sg0 is for SCSI generic devices.