设备文件:类 Unix 系统(如 Linux)中位于 /dev 下的一类特殊文件,用来把硬件设备或内核提供的设备接口(如磁盘、终端、随机数发生器)以“像文件一样读写”的方式暴露给程序。它通常分为字符设备文件(character device)和块设备文件(block device)。
/dɪˈvaɪs faɪl/
Programs can read from a device file like /dev/urandom to get random bytes.
程序可以像读文件一样从 /dev/urandom 读取随机字节。
If the permissions on the device file are wrong, the daemon may fail to access the hardware and crash at startup.
如果设备文件的权限设置不当,守护进程可能无法访问硬件,并在启动时崩溃。
device 源自拉丁语 dividere(分开、分配),经法语演变出“装置、器具”的含义;file 来自古法语 fil(线),引申为“把资料按序串起来的一条线”,在计算机语境中固定为“文件”。“device file”这一术语来自 Unix 的设计理念:用统一的“文件”抽象来表示外部设备与系统资源。