[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 3

lsdev Command

Purpose

Displays devices in the system and their characteristics.

Syntax

lsdev -C [ -c Class ] [ -s Subclass ] [ -t Type ] [ -f File ] [ -F Format | -r ColumnName ] [ -h ] [ -H ] [ -l Name ] [ -S State ]

lsdev -P [ -c Class ] [ -s Subclass ] [ -t Type ] [ -f File ] [ -F Format | -r ColumnName ] [ -h ] [ -H ]

Description

The lsdev command displays information about devices in the Device Configuration database. You can display information about all devices in the Customized Devices object class using the -C flag. Any combination of the -c Class, -s Subclass, -t Type, -l Name, and -S State flags selects a subset of the customized devices. You can display information about all devices in the Predefined Devices object class using the -P flag. Any combination of the -c Class, -s Subclass, and -t Type flags selects a subset of the predefined devices.

You can display the default output one of two ways. You can either display the default output from the Customized Devices object class using the -C flag, or display the default output from the Predefined Devices object class using the -P flag. To override these two default outputs, you can use the -F Format flag. The -F Format flag displays the output in a user-specified format where the Format parameter is a quoted list of column names separated and possibly ended by nonalphanumeric characters or white space.

The -r ColumnName flag displays the range of values for a particular column over the specified set of devices.

You can use the Devices application in Web-based System Manager (wsm) to change device characteristics. You could also use the System Management Interface Tool (SMIT) smit lsdev fast path to run this command.

Flags

-C Lists information about a device that is in the Customized Devices object class. The default information displayed is name, status, location, and description. This flag cannot be used with the -P flag.
-c Class Specifies a device class name. This flag can be used to restrict output to devices in a specified class.
-f File Reads the needed flags from the File parameter.
-F Format Displays the output in a user-specified format, where the Format parameter is a quoted list of column names from the Predefined or Customized Devices object class, separated and possibly ended by nonalphanumeric characters or white space. Using white space as the separator, the lsdev command displays the output in aligned columns.

If you specify the -F Format flag with the -C flag, you can specify column names from both the Customized and Predefined Devices object classes. If you specify the -F Format flag with the -P flag, you can only specify column names from the Predefined Devices object class. In addition to the column names, the special purpose name description can be used to obtain a display of device descriptions. This flag cannot be used with the -r ColumnName flag. Also, the physloc special purpose name can be used to display a device's physical location code.

-H Displays headers above the column output.
-h Displays the command usage message.
-l Name Specifies the device logical name from the Customized Devices object class for the device for which information is listed. This flag cannot be used with the -P flag.
-P Lists information about a device that is in the Predefined Devices object class. The default information displayed is class, type, subclass, description. This flag cannot be used with the -C, -l, or -S flags.
-r ColumnName Displays the set of values in a column. For example, the ColumnName parameter takes the value of the Class parameter to list all the classes. If you specify the -r ColumnName flag with the -C flag, you can specify column names from both the Customized and Predefined Devices object classes. If you specify the -r ColumnName flag with the -P flag, you can only specify column names from the Predefined Devices object class. This flag cannot be used with the -F Format flag.
-S State Lists all devices in a specified state as named by the State parameter. This flag cannot be used with the -P flag. The State parameter can either be a value of d, D, 0 or defined for the Defined state; a, A, 1, or available for the Available state; or s, S, 2, or stopped for the Stopped state. This flag can be used to restrict output to devices in a specified state.
-s Subclass Specifies a device subclass name. This flag can be used to restrict output to devices in a specified subclass.
-t Type Specifies a device type name. This flag can be used to restrict output to devices of a specified type.

Examples

  1. To list all devices in the Predefined Devices object class with column headers,enter:
    lsdev -P -H
    The system displays a message similar to the following:

    class    type     subclass    description
     
    adapter   kts      sio        Keyboard/Tablet/Sound system
    keyboard  kb101    keyboard   United States keyboard
    keyboard  kb102    keyboard   International keyboard
    keyboard  kb106    keyboard   Kanji keyboard
    keyboard  kb5086   keyboard   5086 keyboard
    tablet    5083_m21 tablet     6.144 x 6.144 inch tablet
    tablet    5083_m22 tablet     11.5 x 11.5 inch tablet
    .
    .
    .
    tty       tty       rs232     Asynchronous Terminal
    tty       tty       rs422     Asynchronous Terminal
    tty       tty       mil188    Asynchronous Terminal
  2. To list all the devices in the Customized Devices object class, enter:
    lsdev -C
    The system displays a message similar to the following:

    sio0     Available  00-00         Standard I/O Planar
    fda0     Available  00-00-0D      Standard I/O Diskette Adapter
    sa0      Available  00-00-S1      Standard I/O Serial Port 1
    sa1      Available  00-00-S2      I/O Serial Port 2
    tty0     Defined                  Asynchronous Terminal
    .
    .
    .
    scsi0    Available  00-07         SCSI I/O Controller
    cd0      Available  00-07-00-30   CD-ROM Drive
    rmt0     Available  00-07-00-40   2.3 GB 8mm Tape Drive
    hdisk0   Available  00-07-00-00   670 MB SCSI Disk Drive
    hdisk1   Available  00-07-00-10   670 MB SCSI Disk Drive
    hdisk2   Available  00-07-00-20   670 MB SCSI Disk Drive 
  3. To list the adapters that are in the Available state in the Customized Devices object class, enter:
    lsdev -C -c adapter -S a
    The system displays a message similar to the following:

    sio0     Available  00-00         Standard I/O Planar
    fda0     Available  00-00-0D      Standard I/O Diskette Adapter
    kts0     Available  00-00-0K      Keyboard Tablet/Sound system
    sa0      Available  00-00-S1      Standard I/O Serial Port 1
    sa1      Available  00-00-S2      Standard I/O Serial Port 2
    scsi0    Available  00-07         SCSI I/O Controller
    mous0    Available  00-00-0M      Mouse device
  4. To list all tape devices in the Predefined Devices object class, enter:
    lsdev -P -c tape
    The system displays a message similar to the following:

    tape    8mm     scsi    2.3GB 8mm Tape Drive
    tape    9trk    scsi    1.2-inch 9-Track Tape Drive
    tape    150mb   scsi    150 MB 1/4-inch Tape Drive
  5. To list the supported device classes from the Predefined Devices object class, enter:
    lsdev -P -r class
    The system displays a message similar to the following:

    adapter
    bus
    cdrom
    disk
    diskette
    .
    .
    .
    planar
    printer
    pty
    sys
    sysunit
    tablet
    tape
    tcpip
    tty
  6. To list the supported subclasses in the Predefined Devices object class for the disk class, enter:
    lsdev -P -c disk -r subclass
    The system displays a message similar to the following:

    mca
    scsi
  7. To list the name, class, subclass, and type of every device in the Available state in the Customized Devices object class with column headers, enter:
    lsdev -C -H -S a -F 'name class subclass type'
    The system displays a message similar to the following for AIX 5.1 and earlier:

    name        class                subclass        type
     
    sys0        sys                  node            sys
    sysunit0    sysunit              sys             sysunit
    .
    .
    .
    sa0         adapter              mca              8p232
    fd0         diskette             siofd            fd
    fd1         diskette             siofd            fd
    tty0        tty                  rs232            tty
    scsi0       adapter              mca              hscsi
    hdisk0      disk                 scsi             670mb
    hdisk1      disk                 scsi             355mb
    lp0         printer              parallel         4201-3

Files

/usr/sbin/lsdev Contains the lsdev command.

Related Information

The chdev command, lsattr command, lsconn command, lsparent command, mkdev command, rmdev command.

Devices Overview for System Management in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices provides information about adding, changing, moving, and removing devices.

For information on installing the Web-based System Manager, see Chapter 2: Installation and System Requirements in AIX 5L Version 5.2 Web-based System Manager Administration Guide.

System Management Interface Tool (SMIT) Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices tells you about the SMIT application.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]