1 .\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998.
3 .\" This file may be copied under the conditions described
4 .\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998
5 .\" that should have been distributed together with this file.
7 .TH MKNOD 1 1998-11 "GNU fileutils 4.0"
9 mknod \- make block or character special files
11 .BI "mknod [" options "] " name " {bc} " "major minor"
13 .BI "mknod [" options "] " name " p"
15 GNU options (shortest form):
16 .BI "[\-m " mode "] [\-\-help] [\-\-version] [\-\-]"
19 creates a FIFO (named pipe), character special file, or block special
20 file with the specified
23 A special file is a triple (boolean, integer, integer)
24 stored in the filesystem.
25 The boolean chooses between character special file and
26 block special file. The two integers are the major and minor
29 Thus, a special file takes almost no place on disk, and is used
30 only for communication with the operating system, not for data
31 storage. Often special files refer to hardware devices (disk, tape, tty,
32 printer) or to operating system services (/dev/null, /dev/random).
34 Block special files usually are disk-like devices
35 (where data can be accessed given a block number,
36 and e.g. it is meaningful to have a block cache).
37 All other devices are character special files.
38 (Long ago the distinction was a different one: I/O to
39 a character special file would be unbuffered, to a block
40 special file buffered.)
44 command is what creates files of this type.
46 The argument following
48 specifies the type of file to make:
55 for a block (buffered) special file
58 for a character (unbuffered) special file
65 (`unbuffered') as a synonym for
68 When making a block or character special file, the major and minor
69 device numbers must be given after the file type (in decimal, or
70 in octal with leading 0; the GNU version also allows hexadecimal
72 By default, the mode of created files is 0666 (`a+rw') minus the bits
76 .BI "\-m " mode ", \-\-mode=" mode
77 Set the mode of created files to
79 which can be symbolic as in
81 and then uses the default mode as the point of departure.
82 .SH "GNU STANDARD OPTIONS"
85 Print a usage message on standard output and exit successfully.
88 Print version information on standard output, then exit successfully.
91 Terminate option list.
93 POSIX does not describe this command as it is nonportable,
99 with the above syntax, but without the mode option.
101 On a Linux system (version 1.3.22 or newer) the file
102 .I /usr/src/linux/Documentation/devices.tex
103 contains a list of devices with device name, type, major and minor number.
105 The present page describes
107 as found in the fileutils-4.0 package;
108 other versions may differ slightly.