]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man1/mknod.1
Import of man-pages 1.70
[thirdparty/man-pages.git] / man1 / mknod.1
1 .\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998.
2 .\"
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.
6 .\"
7 .TH MKNOD 1 1998-11 "GNU fileutils 4.0"
8 .SH NAME
9 mknod \- make block or character special files
10 .SH SYNOPSIS
11 .BI "mknod [" options "] " name " {bc} " "major minor"
12 .br
13 .BI "mknod [" options "] " name " p"
14 .sp
15 GNU options (shortest form):
16 .BI "[\-m " mode "] [\-\-help] [\-\-version] [\-\-]"
17 .SH DESCRIPTION
18 .B mknod
19 creates a FIFO (named pipe), character special file, or block special
20 file with the specified
21 .IR name .
22 .PP
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
27 device number.
28 .PP
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).
33 .PP
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.)
41 .PP
42 The
43 .B mknod
44 command is what creates files of this type.
45 .PP
46 The argument following
47 .I name
48 specifies the type of file to make:
49 .RS
50 .TP
51 .B p
52 for a FIFO
53 .TP
54 .B b
55 for a block (buffered) special file
56 .TP
57 .B c
58 for a character (unbuffered) special file
59 .RE
60 .PP
61 The GNU version of
62 .B mknod
63 allows
64 .B u
65 (`unbuffered') as a synonym for
66 .BR c .
67 .PP
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
71 with leading 0x).
72 By default, the mode of created files is 0666 (`a+rw') minus the bits
73 set in the umask.
74 .SH OPTIONS
75 .TP
76 .BI "\-m " mode ", \-\-mode=" mode
77 Set the mode of created files to
78 .IR mode ,
79 which can be symbolic as in
80 .BR chmod (1)
81 and then uses the default mode as the point of departure.
82 .SH "GNU STANDARD OPTIONS"
83 .TP
84 .B "\-\-help"
85 Print a usage message on standard output and exit successfully.
86 .TP
87 .B "\-\-version"
88 Print version information on standard output, then exit successfully.
89 .TP
90 .B "\-\-"
91 Terminate option list.
92 .SH "CONFORMING TO"
93 POSIX does not describe this command as it is nonportable,
94 and recommends using
95 .BR mkfifo (1)
96 to make FIFOs.
97 SVID has a command
98 .I /etc/mknod
99 with the above syntax, but without the mode option.
100 .SH NOTES
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.
104 .LP
105 The present page describes
106 .B mknod
107 as found in the fileutils-4.0 package;
108 other versions may differ slightly.
109 .SH "SEE ALSO"
110 .BR chmod (1),
111 .BR mkfifo (1),
112 .BR mknod (2)