I understand that block/character device files are created programmatically (by the drivers themselves?) to facilitate communications with device drivers using standard I/O calls. But why one would create these device files from command line using mknod?Please provide some common use cases.
What are some common use cases for creating block/character device files from the shell with mknod?
linux;devices
Historical reasons. Originally, before devfs existed, these device files were created by hand or by a script called MAKEDEV. This is also why many drivers have a fixed device number assignment; because the device numbers had to be known so that the device files would work properly.There aren't really any common use cases for the mknod command on modern Linux systems, though it may still be used for system recovery or for very small systems that exclude devfs.