Linux Everything is a document , Before the system communicates with the device , To create a store in /dev Device files in directory , Many device files have been generated by default , Sometimes I create some new device files manually , This will be used mknod.
Grammar format :mknod[ Options ][ File name ] [ file type ] [ The main equipment, ] [ Secondary device number ]

Common parameters
-Z Set the security context
-m Set permission mode
b Block device
c Character device
-help Display help information
--version Display version information

among -m The following parameters can be ( Be similar to chmod):
400 -r-------- The owner can read , No one else can do anything ;
644 -rw-r–r– All owners can read , But only the owner can edit ;
660 -rw-rw---- Both owners and group users can read and write , No one else can do anything ;
664 -rw-rw-r– Everyone can read , But only owners and group users can edit ;
700 -rwx------ The owner can read 、 Write and execute , Other users can't do anything ;
744 -rwxr–r– Everyone can read , But only the owner can edit and execute ;
755 -rwxr-xr-x Everyone can read and execute , But only the owner can edit ;
777 -rwxrwxrwx Everyone can read 、 Write and execute (linux In general, do not set the execution permission of the file in ! Even if we create a file, it has no execution permission by default , It's only after you give it manually .)
Example :

sudo mknod   /dev/dev1 c 50  1                // Create character devices  /dev/console2, The main device number is 50, The secondary equipment number is 1sudo mknod -m 660  /dev/dev2 c 50 2    // Create character devices  /dev/dev2 , And set the permission to 660( Users and groups can read and write ) , The main device number is 50, The secondary equipment number is 2