mknod(5) File Formats Manual mknod(5)NAME
mknod.h - header file of macros for handling device numbers
SYNOPSIS DESCRIPTION
The header file defines macros to create and interpret device identification numbers for use with the system call (see mknod(2)).
The use of these macros is architecture-dependent. See the System Administration Manual for your system for information on how to select
major and minor device numbers.
contains the macro
which packs the major and minor components into a device identification number suitable for the dev argument of and the two macros:
which extract the major and minor number components, respectively, from a device identification number, dev.
The macro is a specification (see printf(3S)) that prints the minor number in the format best suited to the particular implementation; it
is used by the long format of the command (see ls(1)) to show the minor numbers for device files.
The base of the number is indicated in the same way as in the C programming language: no leading zero for decimal, leading zero for octal,
and leading for hexadecimal.
SEE ALSO ls(1), mknod(1M), mknod(2), printf(3S).
mknod(5)
Check Out this Related Man Page
mknod(8) System Manager's Manual mknod(8)NAME
mknod - Creates a special file
SYNOPSIS
/usr/sbin/mknod special_file [ b major_device# minor_device# | c major_device# minor_device#]
/usr/sbin/mknod filename p
DESCRIPTION
The mknod command makes a directory entry. The first argument is the name of the special device file. Select a name that is descriptive
of the device.
The mknod command has two forms. In the first form, the second argument is the b or c flag. The last two arguments are numbers specifying
the major_device, which helps the operating system find the device driver code, and the minor_device, the unit drive, or line number, which
may be either decimal or octal.
The assignment of major device numbers is specific to each system. You can determine the device numbers by examining the conf.c system
source file. If you change the contents of the conf.c file to add a device driver, you must rebuild the kernel.
In the second form of mknod, you use the p flag to create named pipes (FIFOs).
Only the superuser can create a character or device special file.
FLAGS
Indicates that the special file corresponds to a block-oriented device (disk or tape) Indicates that the special file corresponds to a
character-oriented device Creates named pipes (FIFOs)
EXAMPLES
To create the special file for a new drive, /dev/disk/dsk20, with a major device number of 1 and a minor device number of 2, enter: mknod
/dev/disk/dsk20 b 1 2 This command creates the special file, /dev/disk/dsk20, which is a block special file with major device number 1
and minor device number 2. To create a pipe named fifo, enter: mknod fifo p This command creates the pipe fifo, which is not necessarily
in the current directory.
FILES
Specifies the command path Specifies the system device numbers specification file delim off
mknod(8)
Can someone please tell me what the command mknod does and what it's syntax is? I can't find it in my "Unix for dummies" book or "Unix in s nutshell". I found it in an existing script that I want to copy, but I want to understand what I am doing. The script is going to do a full export of an... (3 Replies)
hi, i would like to extract the header and put it in a variable, then use printf to output the variable, but i keep on getting errors...please tell me if my format is incorrect.
HDR = "`ps -e -o user,pid,ppid,pcpu,stime,etime,time,comm | head -n 1`"
printf (%s, $HDR);
thanks! (3 Replies)
Hi
Can anyone tell me what is major number and minor number in the mknod command. Also what these numbers mean.
I have gone through the man pages but still I couldn't understand.
Regards (3 Replies)
Something (I'm still trying to find out what) has clobbered our /dev/null and made it into an ordinary file. I know I need to recreate it with mknod, but I'm unsure what the major and minor device numbers should be - I know enough to know that they vary on different systems and I've seen 1 3, 2 2,... (4 Replies)
Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Hi,
I'm new to HP-Unix programming; I have a few programs, don't know the programming language used. I have to make minor changes and to recompile the source code. How do I find the programming language used and the compiler?
Thanks,
Nick. (3 Replies)
Hi,
Can anyone help me how to add leading zero's (0's) infront of numbers in unix script.
For more details.
x=450
Y=2344
i want the out put of 00000450, 000002344 (leading 5 zeros)
Thanks
A. Raj. (8 Replies)
I need to extract all the p-value numbers and the rho numbers from a .txt file and write them as coma separated values in a new file. Ideally I would get two files in the end, one for p- values and one for rho. Any suggestions? I appreciate your help!!!
The .txt file looks essentially like this... (5 Replies)
Hi guys,
I am new to unix shell scripts. I have a file-A.txt which contained several names in "ABCo12345678.gz_to_ABCn12345678.gz" format. I want to extract the numbers in a "for" loop that means I can not use cut -c6-13 A.txt.Dose anyone know how to do it by using awk? Thank you so much.
... (4 Replies)
Hi Guys,
Can someone give me a simple script that can extract the numbers in between numbers from start to end. As shown below, it start from 100 to 110 and revealed the numbers in between.
INPUT:
100 - 110
DESIRED OUTPUT:
100
101
102
103
104
105
106
107 (6 Replies)
mknod /dev/vda b 253 0
mknod /dev/vda1 b 253 1
mknod /dev/vda2 b 253 2
mknod /dev/vda3 b 253 3
I know below code is ease to handle, but I don't know above code
mknod /dev/vda1 b 253 1
mknod /dev/vda2 b 253 2
mknod /dev/vda3 b 253 3 (3 Replies)
Basically I have a text file that is made up of customer statements. I want to be able to separate the customer statements into their own file. The file is consistant in that the account # (part of the key) is always on line 10 then on every 55th line from there on out so my logic would be like: ... (17 Replies)
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)
I have this script that will monitor filesystems and send me e-amil alerts.
#! /bin/ksh
DIST_LIST=monitor@...com
WORKDIR=/home/monitor
WARNLEVEL=90
MAIL_SUBJ="filesystems monitor on "$(hostname)
... (3 Replies)