getdev Command
Purpose
Lists devices that match the specified criteria.
Syntax
getdev [ -a ] [ -e ] [ Criteria] [ DeviceList ]
Description
Lists devices that match the given criteria. The criteria is given in the form of expressions. The getdev command can check all devices on the system or a specified list of devices.
Flags
Item | Description |
---|---|
-a | Specifies that a device must match all criteria to be included in the list generated by this command. The -a flag has no effect if no criteria are defined. |
-e | Specifies that the devices provided in the devicelist be excluded from the list generated by the getdev command. Without the -e flag only devices in the devicelist are generated. This flag is ignored if no devices are specified. |
Parameters
Item | Description |
---|---|
Criteria | Defines criteria that a device must match before
it can be included in the generated list. Criteria can be specified
as an expression or a list of expressions which a device must meet
for it to be included in the list generated by getdev. If no
criteria are provided, all devices are included in the list. Devices must satisfy at least one of the criteria in the list. However, the -a option can be used to specify that a "logical and" operation should be performed. Then, only those devices that match all of the criteria in a list will be included. There are four possible
expression types which the criteria specified in the Criteria parameter may follow:
The following are the valid device attributes:
|
DeviceList | Specifies a space-separated list of devices to be checked for the Criteria. |
Exit Status
- 0
- The command completed successfully
- > 1
- Failure has occurred.
Examples
- To display all devices, enter:
getdev
- To list devices which are of type "logical_volume", enter:
getdev type=logical_volume
- To list devices which are not of type "logical_volume", enter:
getdev type!=logical_volume
- To list devices which are of type "logical_volume" or whose device
alias is "sys0", enter:
The output will look similar to the following:getdev type=logical_volume alias=sys0
hd1 hd2 hd3 hd4 ... sys0
- To list devices which are of type "logical_volume" and whose device
alias is "lv01", enter:
getdev -a type=logical_volume alias=lv01
- To display devices for which the status attribute is defined
, enter:
getdev status:*
- To display devices for which the desc attribute is not
defined , enter:
getdev desc!:*
Files
Item | Description |
---|---|
/usr/sbin/getdev | Contains the getdev command |