HP-UX Reference (11i v2 07/12) - 1M System Administration Commands A-M (vol 3)
l
lsdev(1M) lsdev(1M)
NAME
lsdev - list device drivers in the system
SYNOPSIS
/usr/sbin/lsdev
[-h][-d driver -C class][
-b block_major][-c char_major][-e major]
[major ...]
DESCRIPTION
The
lsdev command lists, one pair per line, the major device numbers and driver names of device drivers
configured into the system and available for invocation via special files. A
−1 in either the block or charac-
ter column means that a major number does not exist for that type.
If no arguments are specified,
lsdev
lists all drivers configured into the system.
If the
-h option is specified,
lsdev will not print a heading. This option may be useful when the output of
lsdev will be used by another program.
The -d, -C, -b,
-c, and -e options are used to select specific device drivers for output. If more than one
option is specified, all drivers that match the criteria specified by those options will be listed. These search
options are divided into two types: name search keys (the
-d and -C options) and major number search
keys (the -b, -c, and -e options). If both types of options are present, only entries that match both types
are printed. The same type of option may appear more than once on the command line with each
occurrence providing an ORing effect of that search type. The -d and -C options may not be specified at
the same time.
The ability to process major arguments is provided for compatibility and functions like the
-e option.
Options
-C class List device drivers that match class.
-d driver List device drivers with the name driver.
-b block_major List device drivers with a block major number of block_major.
-c char_major List device drivers with a character major number of char_major.
-e major List device drivers with either a character major number or block major equal to
major.
DIAGNOSTICS
Invalid combination of options
The -d and -C options may not be specified at the same time.
Invalid major number
A major number is malformed or out of range.
EXAMPLES
To output entries for all drivers in the pseudo class:
lsdev -C pseudo
To output entries that are in the class disk that have either a block or character major number of 0:
lsdev -C disk -e 0
To get the character major number of my_driver into a shell environment variable:
C_MAJOR=$(lsdev -h -d my_driver | awk ’{print $1}’)
WARNINGS
Some device drivers available from the system may be intended for use by other drivers. Attempting to use
them directly from a special file may produce unexpected results.
A driver may be listed even when the hardware requiring the driver is not present. Attempts to access a
driver without the corresponding hardware will fail.
lsdev only lists drivers that are configured into the currently executing kernel. For a complete list of
available drivers, please run sam (see sam(1M).
HP-UX 11i Version 2: December 2007 Update − 1 − Hewlett-Packard Company 513