mirror of https://github.com/mkerrisk/man-pages
113 lines
3.1 KiB
Groff
113 lines
3.1 KiB
Groff
.\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998.
|
|
.\"
|
|
.\" This file may be copied under the conditions described
|
|
.\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998
|
|
.\" that should have been distributed together with this file.
|
|
.\"
|
|
.TH MKNOD 1 1998-11 "GNU fileutils 4.0"
|
|
.SH NAME
|
|
mknod \- make block or character special files
|
|
.SH SYNOPSIS
|
|
.BI "mknod [" options "] " name " {bc} " "major minor"
|
|
.br
|
|
.BI "mknod [" options "] " name " p"
|
|
.sp
|
|
GNU options (shortest form):
|
|
.BI "[\-m " mode "] [\-\-help] [\-\-version] [\-\-]"
|
|
.SH DESCRIPTION
|
|
.B mknod
|
|
creates a FIFO (named pipe), character special file, or block special
|
|
file with the specified
|
|
.IR name .
|
|
.PP
|
|
A special file is a triple (boolean, integer, integer)
|
|
stored in the filesystem.
|
|
The boolean chooses between character special file and
|
|
block special file. The two integers are the major and minor
|
|
device number.
|
|
.PP
|
|
Thus, a special file takes almost no place on disk, and is used
|
|
only for communication with the operating system, not for data
|
|
storage. Often special files refer to hardware devices (disk, tape, tty,
|
|
printer) or to operating system services (/dev/null, /dev/random).
|
|
.PP
|
|
Block special files usually are disk-like devices
|
|
(where data can be accessed given a block number,
|
|
and e.g. it is meaningful to have a block cache).
|
|
All other devices are character special files.
|
|
(Long ago the distinction was a different one: I/O to
|
|
a character special file would be unbuffered, to a block
|
|
special file buffered.)
|
|
.PP
|
|
The
|
|
.B mknod
|
|
command is what creates files of this type.
|
|
.PP
|
|
The argument following
|
|
.I name
|
|
specifies the type of file to make:
|
|
.RS
|
|
.TP
|
|
.B p
|
|
for a FIFO
|
|
.TP
|
|
.B b
|
|
for a block (buffered) special file
|
|
.TP
|
|
.B c
|
|
for a character (unbuffered) special file
|
|
.RE
|
|
.PP
|
|
The GNU version of
|
|
.B mknod
|
|
allows
|
|
.B u
|
|
(`unbuffered') as a synonym for
|
|
.BR c .
|
|
.PP
|
|
When making a block or character special file, the major and minor
|
|
device numbers must be given after the file type (in decimal, or
|
|
in octal with leading 0; the GNU version also allows hexadecimal
|
|
with leading 0x).
|
|
By default, the mode of created files is 0666 (`a+rw') minus the bits
|
|
set in the umask.
|
|
.SH OPTIONS
|
|
.TP
|
|
.BI "\-m " mode ", \-\-mode=" mode
|
|
Set the mode of created files to
|
|
.IR mode ,
|
|
which can be symbolic as in
|
|
.BR chmod (1)
|
|
and then uses the default mode as the point of departure.
|
|
.SH "GNU STANDARD OPTIONS"
|
|
.TP
|
|
.B "\-\-help"
|
|
Print a usage message on standard output and exit successfully.
|
|
.TP
|
|
.B "\-\-version"
|
|
Print version information on standard output, then exit successfully.
|
|
.TP
|
|
.B "\-\-"
|
|
Terminate option list.
|
|
.SH "CONFORMING TO"
|
|
POSIX does not describe this command as it is nonportable,
|
|
and recommends using
|
|
.BR mkfifo (1)
|
|
to make FIFOs.
|
|
SVID has a command
|
|
.I /etc/mknod
|
|
with the above syntax, but without the mode option.
|
|
.SH NOTES
|
|
On a Linux system (version 1.3.22 or newer) the file
|
|
.I /usr/src/linux/Documentation/devices.txt
|
|
contains a list of devices with device name, type, major and minor number.
|
|
.LP
|
|
The present page describes
|
|
.B mknod
|
|
as found in the fileutils-4.0 package;
|
|
other versions may differ slightly.
|
|
.SH "SEE ALSO"
|
|
.BR chmod (1),
|
|
.BR mkfifo (1),
|
|
.BR mknod (2)
|