Which of the following statements is correct when talking about /proc/?

A. All changes to files in /proc/ are stored in /etc/proc.d/ and restored on reboot.
B. All files within /proc/ are read-only and their contents cannot be changed.
C. All changes to files in /proc/ are immediately recognized by the kernel.
D. All files within /proc/ are only readable by the root user.

题解

选项 A,直接更改 /proc 目录里的文件,只会影响到内存的内容,并不会将设置存在任何硬盘的设置档内。反过来若是直接设置硬盘的设置档,则可以永久地让设置套用至 /proc 的目录中,例如修改「/etc/sysctl.conf」会影响到「/proc/sys/」。

选项 B,/proc 目录里的文件可以读写。

选项 C,修改 /proc 目录里的文件,会立即影响到系统的运作。

选项 D,/proc 目录里的部份文件,也可以让 root 之外的用户来读取。