coreutils: mknod invocation
1
1 12.5 ‘mknod’: Make block or character special files
1 ===================================================
1
1 ‘mknod’ creates a FIFO, character special file, or block special file
1 with the specified name. Synopsis:
1
1 mknod [OPTION]... NAME TYPE [MAJOR MINOR]
1
1 Unlike the phrase “special file type” above, the term “special file”
1 has a technical meaning on Unix: something that can generate or receive
1 data. Usually this corresponds to a physical piece of hardware, e.g., a
1 printer or a disk. (These files are typically created at
1 system-configuration time.) The ‘mknod’ command is what creates files
1 of this type. Such devices can be read either a character at a time or
1 a “block” (many characters) at a time, hence we say there are “block
1 special” files and “character special” files.
1
1 Due to shell aliases and built-in ‘mknod’ functions, using an
1 unadorned ‘mknod’ interactively or in a script may get you different
1 functionality than that described here. Invoke it via ‘env’ (i.e., ‘env
1 mknod ...’) to avoid interference from the shell.
1
1 The arguments after NAME specify the type of file to make:
1
1 ‘p’
1 for a FIFO
1
1 ‘b’
1 for a block special file
1
1 ‘c’
1 for a character special file
1
1 When making a block or character special file, the major and minor
1 device numbers must be given after the file type. If a major or minor
1 device number begins with ‘0x’ or ‘0X’, it is interpreted as
1 hexadecimal; otherwise, if it begins with ‘0’, as octal; otherwise, as
1 decimal.
1
11 The program accepts the following options. Also see ⇒Common
options.
1
1 ‘-m MODE’
1 ‘--mode=MODE’
1 Set the mode of created files to MODE, which is symbolic as in
1 ‘chmod’ and uses ‘a=rw’ as the point of departure. MODE should
1 specify only file permission bits. ⇒File permissions.
1
1 ‘-Z’
1 ‘--context[=CONTEXT]’
1 Without a specified CONTEXT, adjust the SELinux security context
1 according to the system default type for destination files,
1 similarly to the ‘restorecon’ command. The long form of this
1 option with a specific context specified, will set the context for
1 newly created files only. With a specified context, if both
1 SELinux and SMACK are disabled, a warning is issued.
1
1 An exit status of zero indicates success, and a nonzero value
1 indicates failure.
1