mknod

From RaySoft

mknod creates a FIFO, character special file, or block special file with the specified NAME.[1]

Documentation

Syntax

mknod [PARAMETER ...] NAME TYPE [MAJOR MINOR]

Types

b
for a block special file
c
for a character special file
p
for a FIFO

Parameters

-m MODE, --mode=MODE
Set the MODE of created files to mode, which is symbolic as in chmod and uses a=rw as the point of departure. MODE should specify only file permission bits.
-Z CONTEXT, --context=CONTEXT
Without a specified CONTEXT, adjust the SELinux security context according to the system default type for destination files, similarly to the restorecon command. The long form of this option with a specific CONTEXT specified, will set the context for newly created files only.

Examples

Create a node for sda8
mknod '/dev/sda8' 'b' 3 8
ls -l '/dev/sda8'

Output:

brw-r--r--. 1 root root 3, 8 2010-08-30 20:11 /dev/sda8

References