devprop - 显示设备属性值或设备路径信息
/usr/sbin/devprop [-n device-path] [-v] [-{e|b|i|l|s}] [-q] [-c separator] property-name ...
/usr/sbin/devprop -a [-v] [-{e|b|i|l|s}] [-q] [-c separator] property-name ...
-n device-path 和 –a 的使用互斥。如果两者均未指定,则假定使用 '–n /'。
如果未指定任何属性名称,devprop -n device-path 命令会为现有的每个 device-path 属性生成一行 property-name=property-value 输出。
对于指定的每个属性名称,devprop -n device-path 命令会生成一行详细说明属性值的输出。如果未在 device-path 节点上定义 property-name,则输出是一个空行。如果指定了 –v 选项,则输出的每一行都以 "property-name=" 开头。
devprop -a 命令查找定义指定的每个 property-name 的所有设备路径。如果未指定 –v 选项,则针对每个符合条件的 device-path 生成一行 "device-path" 输出(与使用的属性名称数量无关)。如果指定了 –v 选项,则针对每个指定的 property-name 生成一行 device-path property-name=property-value 输出。
其他所有命令行选项均与属性值的类型和显示的变化形式相关。如果存在布尔属性值,它将输出 true(使用了 –e 选项);否则,将输出 false。如果使用选项 –b、–i 或 –l 指定了类型,则 byte、int 或 int_64 属性值将以十六进制格式显示;否则,属性值将以十进制格式显示。–e、–b、–i、–l 和 –s 选项互斥。数组属性值元素由用户定义的分隔符进行分隔。如果指定了 –q 选项,则将字符串属性值用双引号 (") 引起来。
支持以下选项。
要显示其属性的目标设备节点的路径。缺省路径是根节点的路径,等效于指定 -n /。
List the path of every device which defines one or more of specified property-names.This is a more efficient way for management applications to collect information about all devices in the system rather than iterating individual devprop commands over all devices in the system, one by one.
指定 –n 选项的详细模式。对于 –a 选项,在每个属性值前面显示 "property-name="。在设备路径后面显示 "property-name=property-value"。
以下选项与 property-value 的类型相关。
要显示的属性是十六进制字节序列 (DI_PROP_TYPE_BYTES)。
要输出的属性是布尔值 (DI_PROP_TYPE_BOOLEAN)。如果存在 property-name,将输出 "true";否则,将输出 "false"。
要显示的属性是十六进制整数 (DI_PROP_TYPE_INT)。
要显示的属性是 64 位十六进制整数 (DI_PROP_TYPE_INT64)。
要显示的属性是字符串 (DI_PROP_TYPE_STRING)。这是缺省属性。
以下选项与 property-value 的显示相关。
指定数组属性值元素之间的分隔符。使用双引号 (" ") 指定空格。字符串类型的缺省分隔符是加号 (+),其他类型的缺省分隔符是句点 (.),例如 prtconf(8)。
指定带引号的显示模式,在该模式下,显示的字符串属性用双引号 (") 引起来。
只有 -n device-path 调用接受额外的操作数:
针对列表中的每个 property-name,显示 property-value。
No error occurred.
出现错误。
The following example lists the value of the device-nblocks property for a specific device.
# devprop –n /scsi_vhci/disk@g5000cca025a2adac device-nblocks 585937500示例 2 Listing a property name and value for a specific device.
The following example lists the value of the device-nblocks property, together with the property name, for a specific device.
# devprop –v –n /scsi_vhci/disk@g5000cca025a2adac device-nblocks device-nblocks=585937500示例 3 Listing paths for all devices with defined properties.
The following example lists the path of each device that defines one or more of the specified properties.
# devprop –a device-nblocks devid inquiry-serial-no /scsi_vhci/disk@g5000cca025a2adac /scsi_vhci/disk@g5000cca03c08d620 /scsi_vhci/disk@g5000cca0259eadd4 /scsi_vhci/disk@g5000cca03c076d84 /scsi_vhci/disk@g5000cca03c060b00 /scsi_vhci/disk@g5000cca03c074500示例 4 Listing paths for all devices with defined properties, including each property's name and value.
The following example lists the path of each device that provides one of the specified properties in addition to that property's name and value.
# devprop –a –v device-nblocks devid /scsi_vhci/disk@g5000cca025a2adac device-nblocks=585937500 /scsi_vhci/disk@g5000cca025a2adac devid=id1,sd@n5000cca025a2adac /scsi_vhci/disk@g5000cca03c08d620 device-nblocks=585937500 /scsi_vhci/disk@g5000cca03c08d620 devid=id1,sd@n5000cca03c08d620 /scsi_vhci/disk@g5000cca0259eadd4 device-nblocks=585937500 /scsi_vhci/disk@g5000cca0259eadd4 devid=id1,sd@n5000cca0259eadd4 /scsi_vhci/disk@g5000cca03c076d84 device-nblocks=585937500 /scsi_vhci/disk@g5000cca03c076d84 devid=id1,sd@n5000cca03c076d84 /scsi_vhci/disk@g5000cca03c060b00 device-nblocks=585937500 /scsi_vhci/disk@g5000cca03c060b00 devid=id1,sd@n5000cca03c060b00 /scsi_vhci/disk@g5000cca03c074500 device-nblocks=585937500 /scsi_vhci/disk@g5000cca03c074500 devid=id1,sd@n5000cca03c074500
有关下列属性的说明,请参见 attributes(7):
|
实用程序的位置为 Committed(已确定)。由于使用的属性名称和设备路径 "Volatile"(可变),因此实用程序的选项全都 "Uncommitted"(未确定)。一般来说,显示的结果 "Volatile"(可变)并且在很大程度上取决于系统配置。