010-160 practice question 1 of 15

What can be found in the /proc/ directory?

Full set: 81 questions
Answer options
A: One directory per installed program.
B: One device file per hardware device.
C: One file per existing user account.
D: One directory per running process. Correct answer
E: One log file per running service.
Correct Answer:
D. One directory per running process.
Explanation

The /proc filesystem is a special, virtual filesystem in Linux that provides a real-time interface to kernel data structures. It does not contain real files on a disk. Its primary and most well-known feature is that for every process running on the system, a directory is created whose name is the process ID (PID). For example, the process with PID 1234 will have a corresponding directory at /proc/1234/. This directory contains numerous pseudo-files that expose detailed information about the process, such as its memory map (maps), command line (cmdline), and status (status).

Why Incorrect

A. One directory per installed program. Directories for installed program executables are located in paths like /bin, /usr/bin, or /opt, as defined by the Filesystem Hierarchy Standard (FHS).
B. One device file per hardware device. Device files, which represent hardware devices, are located in the /dev directory, not /proc.
C. One file per existing user account. Information about user accounts is stored in files within the /etc directory, such as /etc/passwd and /etc/shadow.
E. One log file per running service. Log files generated by running services and the system are conventionally written to the /var/log directory.

References

1. The Linux man-pages project, proc(5): "The proc filesystem is a pseudo-filesystem which provides an interface to kernel data structures... /proc/[pid] Subdirectory containing information about the process with process ID [pid]." (Source: man 5 proc)

2. Filesystem Hierarchy Standard (FHS) Version 3.0, Section 5.12. /proc : Process information pseudo-filesystem: "The /proc filesystem is the de-facto standard Linux method for handling process and system information... It contains, among other things, a directory for each running process, in the form /proc/PID, where PID is the process-id of the process."

3. University of California, Berkeley, CS 162 Operating Systems and System Programming, Lecture 18, Filesystems (2): "The /proc filesystem... For each process, there is a directory /proc/... This directory contains files that give information about the process." (Referenced in course materials discussing virtual filesystems).

Scroll to Top