lsattr Command

Purpose

Displays attribute characteristics and possible values of attributes for devices in the system.

Syntax

lsattr { -D [ -O ] | -E [ -O ] | -F Format [ -Z Character ] } -l Name [ -a Attribute ] ...[ -f File ] [ -h ] [ -H ]

lsattr { -D [ -O ] | -F Format [ -Z Character ] } { [ -c Class ] [ -s Subclass ] [ -t Type ] } [ -a Attribute ] ... [ -f File ] [ -h ] [ -H ]

lsattr -R { -l Name | [ -c Class ] [ -s Subclass ] [ -t Type ] } -a Attribute [ -f File ] [ -h ] [ -H ]

lsattr -l Name { -o operation [ ... ] } -F Format [ -Z Character ] [ -f File ] [ -h ] [ -H ]

lsattr { [ -c Class ] [ -s Subclass ] [ -t Type ] } { -o operation [ ... ] } -F Format [ -Z Character ] [ -f File ] [ -h ] [ -H ]

Description

The lsattr command displays information about the attributes of a given device or type of device. If you do not specify the device logical name with the -l Nameflag, you must use a combination of one or all of the -c Class, -s Subclass, and -t Type flags to uniquely identify the predefined device.

You must specify one of the following flags with the lsattr command:

Item Description
-D Displays default values.
-E Displays effective values (valid only for customized devices specified with the -l flag).
-F Format Specifies the user-defined format.
-R Displays the range of legal values.

When you display the effective values of the attributes for a customized device, the information is obtained from the Configuration database, not the device. The database values reflect how the device is configured unless it is reconfigured with the chdev command using the -P or -T flag. If this occurs, the information displayed by the lsattr command might not correctly indicate the current device configuration until after the next system boot.

If you use the -D or -E flag, the output defaults to the values for the attribute's name, value, description, and user-settable strings, unless it is also used with the -O flag. The -O flag displays the names of all the attributes specified, separated by colons. On the next line, the -O flag displays all of the corresponding attribute values, separated by colons. The -H flag can be used with either the -D, -E, or -F flag to display headers above the column names. You can define the format of the output with a user-specified format using the -F Format flag, where the Format parameter is a quoted list of column names separated by non-alphanumeric characters or white space. If the -F Format flag is specified, the -Z Character flag may also be specified to change the default record separator from a newline character to the indicated Character.

The lsattr command can display "operation" information from the Extended Predefined Attribute (PdAtXtd) object class. This information is used by the Web-based System Manager. The operation information is accessed through the -o operation flag. The -o operation flag and the -a attribute flag cannot be specified in the same invocation of the lsattr command. The -o operation flag is also not valid with the -R flag. When the -o operation flag is specified, only fields from the PdAtXtd object class can be specified with the -F Format flag.

You can supply the flags either on the command line or using the specified -f File flag.

Flags

Item Description
-a Attribute Displays information for the specified attributes of a specific device or type of device. You can use one -a flag for each attribute name or multiple attribute names. If you use one -a flag for multiple attribute names, the list of attribute names must be enclosed in quotes with spaces between the names. If you use the -R flag, you must specify only one -a flag with only one attribute name. If you do not specify either the -a or -R flag, the lsattr command displays all information for all attributes of the specified device. The -a Attribute flag cannot be used in conjunction with the -o Operation flag. This combination of flags causes the lsattr command to exit with an error message.
-c Class Specifies a device class name. This flag can be used to restrict the output to devices of a specified class. This flag cannot be used with the -E or -l flag.
-D Displays the attribute names, default values, descriptions, and user-settable flag values for a specific device when it is not used with the -O flag. The -D flag displays only the attribute name and default value in colon format when it is used with the -O flag. This flag can be used with any combination of the -c, -s, and -t flags that uniquely identifies a device from the Predefined Devices object class, or with the -l flag. This flag cannot be used with the -E, -F, or -R flags.
-E Displays the attribute names, current values, descriptions, and user-settable flag values for a specific device when it is not used with the -O flag. The -E flag displays only the attribute name and current value in colon format when it is used with the -O flag. This flag cannot be used with the -c, -D, -F, -R, -s, or -t flags.
-f File Reads the necessary 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 separated by nonalphanumeric characters or white space. If white space is used as the separator, the lsattr command displays the output in aligned columns. Only column names from the Predefined Attributes (PdAt), Customized Attributes (CuAt), and the Extended Predefined Attributes (PdAtXtd) object classes can be specified. In addition to the column names, there are two special purpose names that can be used: the name description can be used to obtain a display of attribute descriptions and user_settable can be used to determine whether or not an attribute can be changed. This flag cannot be used with the -E, -D, -O or -R flags.
-H Displays headers above the column output. The -O and -R flag take precedence over the -H flag.
-h Displays the command usage message.
-l Name Specifies the device logical name in the Customized Devices object class whose attribute names or values you want displayed.
-o Operation Displays information for the specified operations of a specific device or type of device. You can use one -o flag for each operation name or multiple operation names. If you use one -o flag for multiple operation names, the list of attribute names must be enclosed in quotes with spaces between the names. Wildcard characters can also be used for the operation name. The valid set of wildcard charcters are the same set used by the odmget command. All operations associated with a specific device, or type of device, can be displayed by using an operation value of "?*". The -o Operation flag cannot be used in conjunction with the -a attribute flag or the -R flag. Any combination of these flags causes the lsattr command to exit with an error message.
-O Displays all attribute names separated by colons and, on the second line, displays all the corresponding attribute values separated by colons. The attribute values are current values when the -E flag is specified and default values when the -D flag is specified. This flag cannot be used with the -F and -R flags.
-R Displays the legal values for an attribute name. The -R flag cannot be used with the -D, -E, -F and -O flags, but can be used with any combination of the -c, -s, and -t flags that uniquely identifies a device from the Predefined Devices object class, or with the -l flag. The -R flag displays the list attribute values in a vertical column as follows:
Value1
Value2
.
.
ValueN

The -R flag displays the range attribute values as x...n(+i) where x is the start of the range, n is the end of the range, and i is the increment.

-s Subclass Specifies a device subclass name. This flag can be used to restrict the output to that for devices of a specified subclass. This flag cannot be used with the -E or -l flag.
-t Type Specifies a device type name. This flag can be used to restrict the output to that for devices of a specified class. This flag cannot be used with the -E or -l flag.
-Z Character The -Z Character flag is used with programs that must deal with ODM fields that might have embedded new line characters. An example of such a program is the Web-based System Manager. The -Z Character flag is used to change the record separator character for each record, or line, of output generated. The new record separator is specified using the Character argument to this flag. The -Z Character flag is only relevant when the -F Format flag is specified. The -Z Character flag cannot be used with the -D, -E, -O, or the -R flags.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To list the current attribute values for the rmt0 tape device, type the following:
    lsattr -l rmt0 -E
    The system displays a message similar to the following:
    mode          yes   Use DEVICE BUFFERS during writes     True
    block_size    1024  BLOCK size (0=variable length)       True
    extfm         yes   Use EXTENDED file marks              True
    ret           no    RETENSION on tape change or reset    True
    density_set_1 37    DENSITY setting #1                   True
    density_set_2 36    DENSITY setting #2                   True
    compress      yes   Use data COMPRESSION                 True
    size_in_mb    12000 Size in Megabytes                    False
    ret_error     no    RETURN error on tape change or reset True
  2. To list the default attribute values for the rmt0 tape device, type the following:
    lsattr -l rmt0 -D
    The system displays a message similar to the following:
    mode          yes   Use DEVICE BUFFERS during writes     True
    block_size    1024  BLOCK size (0=variable length)       True
    extfm         yes   Use EXTENDED file marks              True
    ret           no    RETENSION on tape change or reset    True
    density_set_1 37    DENSITY setting #1                   True
    density_set_2 36    DENSITY setting #2                   True
    compress      yes   Use data COMPRESSION                 True
    size_in_mb    12000 Size in Megabytes                    False
    ret_error     no    RETURN error on tape change or reset True
  3. To list the current value of the bus_intr_lvl attribute for the scsi0 SCSI adapter, type the following:
    lsattr -l scsi0 -a bus_intr_lvl -E
    The system displays a message similar to the following:
    bus_intr_lvl 1 Bus interrupt level False
  4. To list the possible values of the login attribute for the tty0 TTY device, type the following:
    lsattr -l tty0 -a login -R
    The system displays a message similar to the following:
    enable
    disable
    share
    delay
  5. To list the default attribute values for an IBM® 4340 parallel printer, type the following:
    lsattr -c printer -s parallel -t ibm4340 -D
    The system displays a message similar to the following:
    ptop       600       Printer TIME OUT period                    True
    line       60        Number of LINES per page                   True
    col        80        Number of COLUMNS per page                 True
    ind        0         Number of columns to INDENT                True
    plot       no        Send all characters to printer UNMODIFIED  True
    backspace  yes       Send BACKSPACES                            True
    cr         yes       Send CARRIAGE RETURNS                      True
    form       yes       Send FORM FEEDS                            True
    lf         yes       Send LINE FEEDS                            True
    addcr      yes       Add CARRIAGE RETURNS to LINE FEEDS         True
    case       no        Convert lowercase to UPPERCASE             True
    tabs       yes       EXPAND TABS on eight position boundaries   True
    wrap       no        WRAP CHARACTERS beyond the specified width True
    mode       no        Return on ERROR                            True
    interface  standard  Type of PARALLEL INTERFACE                 True
    autoconfig available STATE to be configured at boot time        True
    busy_delay 0         Microseconds to delay between characters   True
  6. To list the possible values of the ptop attribute for an IBM 4340 parallel printer, type the following:
    lsattr -c printer -s parallel -t ibm4340  -a ptop -R
    The system displays a message similar to the following:
    1...1000 (+1)
  7. To list the current attribute values for the rmt0 tape device in colon-separated format, type the following:
    lsattr -l rmt0 -E -O
    The system displays a message similar to the following:
    #mode:block_size:extfm:ret:density_set_1:density_set_2:compress:size_in_mb:ret_error
    yes:1024:yes:no:37:36:yes:12000:no
  8. To display system attributes, type the following:
    lsattr -E -l sys0
    The system displays output similar to the following:
    keylock      normal        State of system keylock at boot time              False
    maxbuf       20            Maximum number of pages in block I/O BUFFER CACHE True
    maxmbuf      0             Maximum Kbytes of real memory allowed for MBUFS   True
    maxuproc     128           Maximum number of PROCESSES allowed per user      True
    autorestart  false         Automatically REBOOT system after a crash         True
    iostat       false         Continuously maintain DISK I/O history            True
    realmem      4194304       Amount of usable physical memory in Kbytes        False
    conslogin    enable        System Console Login                              False
    fwversion    IBM,SPH00221  Firmware version and revision levels              False
    maxpout      0             HIGH water mark for pending write I/Os per file   True
    minpout      0             LOW water mark for pending write I/Os per file    True
    fullcore     false         Enable full CORE dump                             True
    pre430core   false         Use pre-430 style CORE dump                       True
    ncargs       256           ARG/ENV list size in 4K byte blocks               True
    rtasversion  1             Open Firmware RTAS version                        False
    modelname    IBM,7044-270  Machine name                                      False
    systemid     IBM,011037D1F Hardware system identifier                        False
    boottype     disk          N/A                                               False
    SW_dist_intr false         Enable SW distribution of interrupts              True
    cpuguard     disable       CPU Guard                                         True
    frequency    93750000      System Bus Frequency                              False
    Note: The same information is available in a more readable format using SMIT. Select the System Environments -> Change / Show Characteristics of Operating Systems options to view this information.

Files

Item Description
/usr/sbin/lsattr Contains the lsattr command.