The mknod Command
The mknod (make node) command is used for various different purposes in Linux. It can make a first in first out (FIFO) pipe or a block or character mode device file. Format of this command is
mknod [options] device b|c|p|u major minor
The options can be one of the given below:
- help - shows help information and then exits.
-m [mode] - sets the mode of the file to mode instead of the default 0666 (only symbolic notation is permitted).
- version - shows version information, then exits.
The argument after the pathname or device specifies whether the file is a block mode device, character mode device, unbuffered character mode device (u) or FIFO device (p). One of these arguments must be present on the command line.
Following the category of file argument are two numbers for the major and minor device numbers assigned to the new file. Each device on a UNIX system has a unique number which identifies the category of device (the major number) and the specific device itself (the minor number). The major and minor numbers both must be specified for any new block, unbuffered or character, mode device. Device numbers are not specified for a category p device.