IBM Unix Complete Command Guide
IBM Unix Complete Command Guide
3
SC23-4888-05
AIX 5L Version 5.3
SC23-4888-05
Note
Before using this information and the product it supports, read the information in “Notices,” on page 643.
Contents v
chkey Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
chlang Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
chlicense Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
chlpclacl Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
chlpcmd Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
chlpracl Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
chlpriacl Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
chlprsacl Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
chlv Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
chlvcopy Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
chmaster Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
chmod Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
chnamsv Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
chnlspath Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
chnfs Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
chnfsdom Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
chnfsexp Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
chnfsim Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
chnfsmnt Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
chnfsrtd Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
chnfssec Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
chown Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
chpasswd Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
chpath Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
chprtsv Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
chps Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
chpv Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
chque Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
chquedev Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
chresponse Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
chrole Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
chroot Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
chrsrc Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
chsec Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
chsensor Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
chserver Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
chservices Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
chsh Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
chslave Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
chssys Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
chsubserver Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
chtcb Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
chtun Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
chtz Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
chuser Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
chvfs Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
chvg Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
chvirprt Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
chvmode Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
chypdom Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
ckfilt Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
ckpacct Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
ckprereq Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
cksum Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
clear Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
clsnmp Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Contents vii
cxref Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Some commands can be entered simply by typing one word. It is also possible to combine commands so
that the output from one command becomes the input for another command. This is known as pipelining.
Flags further define the actions of commands. A flag is a modifier used with the command name on the
command line, usually preceded by a dash.
Commands can also be grouped together and stored in a file. These are known as shell procedures or
shell scripts. Instead of executing the commands individually, you execute the file that contains the
commands.
Some commands can be constructed using Web-based System Manager applications or the System
Management Interface Tool (SMIT).
Highlighting
The following highlighting conventions are used in this book:
Bold Identifies commands, subroutines, keywords, files, structures, directories, and other items whose
names are predefined by the system. Also identifies graphical objects such as buttons, labels, and
icons that the user selects.
Italics Identifies parameters whose actual names or values are to be supplied by the user.
Monospace Identifies examples of specific data values, examples of text similar to what you might see
displayed, examples of portions of program code similar to what you might write as a programmer,
messages from the system, or information you should actually type.
Format
Each command may include any of the following sections:
To list the fileset that owns all file names that contain installp, enter:
lslpp -w "*installp*"
Once the process is running in the background, you can continue to work and enter other commands on
your system.
At times, you might want to run a command at a specified time or on a specific date. Using the cron
daemon, you can schedule commands to run automatically. Or, using the at and batch commands, you
can run commands at a later time or when the system load level permits.
To display a list of the contents of your current directory, you would type ls and press the Enter key:
$ ls
When you enter a command and it is running, the operating system does not display the shell prompt.
When the command completes its action, the system displays the prompt again. This indicates that you
can enter another command.
The flag alters the way a command works. Many commands have several flags. For example, if you type
the -l (long) flag following the ls command, the system provides additional information about the contents
of the current directory. The following example shows how to use the -l flag with the ls command:
$ ls -l
A parameter consists of a string of characters that follows a command or a flag. It specifies data, such as
the name of a file or directory, or values. In the following example, the directory named /usr/bin is a
parameter:
$ ls -l /usr/bin
When certain commands are entered, the shell prompt changes. Because some commands are actually
programs (such as the telnet command), the prompt changes when you are operating within the
command. Any command that you issue within a program is known as a subcommand. When you exit the
program, the prompt returns to your shell prompt.
The operating system can operate with different shells (for example, Bourne, C, or Korn) and the
commands that you enter are interpreted by the shell. Therefore, you must know what shell you are using
so that you can enter the commands in the correct format.
Stopping Commands
If you enter a command and then decide to stop that command from running, you can halt the command
from processing any further. To stop a command from processing, press the Interrupt key sequence
(usually Ctrl-C or Alt-Pause). When the process is stopped, your shell prompt returns and you can then
enter another command.
ISO 9000
ISO 9000 registered quality systems were used in the development and manufacturing of this product.
Related Information
The following books contain information about or related to commands:
v AIX 5L Version 5.3 Commands Reference, Volume 2
v AIX 5L Version 5.3 Commands Reference, Volume 3
v AIX 5L Version 5.3 Commands Reference, Volume 4
v AIX 5L Version 5.3 Commands Reference, Volume 5
v AIX 5L Version 5.3 Commands Reference, Volume 6
v AIX 5L Version 5.3 Files Reference
v Printers and printing
v Installation and migration
v AIX 5L Version 5.3 AIX Installation in a Partitioned Environment
v AIX 5L Version 5.3 Network Information Services (NIS and NIS+) Guide
v Performance management
v AIX 5L Version 5.3 Performance Tools Guide and Reference
v Security
v Networks and communication management
v Operating system and device management
v AIX 5L Version 5.3 Technical Reference: Base Operating System and Extensions Volume 1
v AIX 5L Version 5.3 Technical Reference: Base Operating System and Extensions Volume 2
v AIX 5L Version 5.3 Technical Reference: Communications Volume 1
v AIX 5L Version 5.3 Technical Reference: Communications Volume 2
v AIX 5L Version 5.3 Technical Reference: Kernel and Subsystems Volume 1
v AIX 5L Version 5.3 Technical Reference: Kernel and Subsystems Volume 2
v AIX 5L Version 5.3 Web-based System Manager Administration Guide
v Performance Toolbox Version 2 and 3 for AIX: Guide and Reference
Purpose
Prints connect-time records.
Syntax
/usr/sbin/acct/ac [ -d ] [ -p ] [ -w File ] [ User ... ]
Description
The ac command prints the total connect time for all users or the connect time for specified users.
Records are based on who logged in during the life of the current wtmp data file.
Connect-time records are created by the init and the login programs and are collected in the
/var/adm/wtmp file, if that file exists. The root user or a member of the adm group should create the
/var/adm/wtmp file with an initial record length of 0 (zero). Records should be processed periodically to
keep the file from becoming too full. If the file has not been created, the following error message is
returned:
No /var/adm/wtmp
If the file becomes too full, additional wtmp files are created. These files can be printed, if specified with
the -w flag.
Flags
-d Creates a printout for each day, from midnight to midnight.
-p Prints connect-time totals by individual login. Without this flag, a total for the time period is printed.
-w File Specifies a wtmp file other than the /var/adm/wtmp file.
Security
Access Control: This command should grant execute (x) access to all users.
Examples
1. To obtain a printout of the connect time for all users who logged in during the life of the current wtmp
data file, enter:
/usr/sbin/acct/ac
2. To obtain a printout of the total connect time for users smith and jones, as recorded in the current
wtmp data file, enter:
/usr/sbin/acct/ac smith jones
3. To obtain a printout of the connect-time subtotals for users smith and jones, as recorded in the current
wtmp data file, enter:
Files
/usr/sbin/acct/ac Contains the ac command.
/var/adm/wtmp Contains the active data file for the collection of connect-time records.
For more information about the Accounting System, the preparation of daily and monthly reports, and the
accounting files, see System accounting in Operating system and device management.
Setting up an accounting subsystem in Operating system and device management explains the steps you
must take to establish an accounting system.
Purpose
Accepts/rejects print requests.
Syntax
accept Destinations
Description
The accept command allows the queuing of print requests for the named Destinations. A Destination can
be either a printer or a class of printers. To find out the status of a destination, run lpstat -a command.
The reject command prevents queuing of print requests for the named destinations. A destination can be
either a printer or a class of printers. To find out the status of a destination, run lpstat -a command.
If you enter accept -? or reject -?, the system displays the command usage message and returns 0.
Flags
-r Reason Assigns a Reason for rejection of requests. The Reason applies to all of the specified Destinations.
The lpstat -a command reports the reason. If it contains blanks, Reason must be enclosed in
quotes. The default reason is unknown reason for existing destinations, and new destination for
destinations just added to the system but not yet accepting requests.
Files
/var/spool/lp/*
Related Information
The enable command, lpadmin command, and lpsched command.
acctcms Command
Purpose
Produces command-usage summaries from accounting records.
Syntax
/usr/sbin/acct/acctcms [ -t | -a [ -o ] [ -p ] ] [ -c ] [ -j ] [ -n ] [ -s ] [ File ... ]
When you use the -o and -p flags together, the acctcms command produces a report that combines prime
and nonprime time. Prime and nonprime times are defined by entries in the /etc/acct/holidays file. Prime
times are assumed to be the period when the system is most active, such as weekdays. Saturdays and
Sundays are always nonprime time for the accounting systems, as are any holidays that you specify in the
/etc/acct/holidays file. All the output summaries are of total usage, except for number of times run, CPU
minutes, and real minutes, which are split into prime and nonprime minutes.
Flags
-a Displays output in ASCII summary format rather than binary summary format. Each output line contains the
command name, the number of times the command was run, total kcore time (memory measurement in
kilobyte segments), total CPU time, total real time, mean memory size (in K-bytes), mean CPU time per
invocation of the command, and the CPU usage factor. The listed times are all in minutes. The acctcms
command normally sorts its output by total kcore minutes. The unit kcore minutes is a measure of the amount
of memory used (in kilobytes) multiplied by the amount of time it was in use. This flag cannot be used with the
-t flag.
When you use the -o and -p flags together, the acctcms command produces a report that combines prime and
non-prime time. Prime and non-prime times are defined by entries in the /etc/acct/holidays file. Prime times
are assumed to be the period when the system is most active, such as weekdays. Saturdays and Sundays are
always non-prime time for the accounting systems, as are any holidays that you specify in the
/etc/acct/holidays file. All the output summaries are of total usage, except for number of times run, CPU
minutes, and real minutes, which are split into prime and non-prime minutes.
Examples
To collect daily command accounting records in a today file and maintain a running total in a total file,
add the following to a shell script:
acctcms File . . . > today
cp total previoustotal
acctcms -s today previoustotal > total
acctcms -a -s total
The File parameters that you specify are redirected to a file called today, added to the previous total (in a
file renamed previoustotal) to produce a new total (called total). All files are binary files. In the last line,
the -a flag displays the total file in ASCII format so you can view the report.
Files
/etc/acct/holidays Specifies prime and nonprime time for accounting records.
/usr/sbin/acct/acctcms Contains the acctcms command.
Related Information
The lastcomm command, runacct command.
For more information about the Accounting System, the preparation of daily and monthly reports, and the
accounting files, see the System accounting in Operating system and device management.
Setting up an accounting subsystem in Operating system and device management describes the steps you
must take to establish an accounting system.
acctcom Command
Purpose
Displays selected process accounting record summaries.
Syntax
/usr/sbin/acct/acctcom [ [ -q | -o File ] | [ -a ] [ -b ] [ -c Classname ] [-f ] [ -h ] [ -i ] [ -k ] [ -m ] [ -r ] [ -t ] [
-v ] [ -w [ -X ] [ -W ]] [ -C Seconds ] [ -g Group ] [ -H Factor ] [ -I Number ] [ -l Line ] [ -n Pattern ] [ -O
Seconds ] [ -u User ] [ -e Time ] [ -E Time ] [ -s Time ] [ -S Time ] [ File ... ]
Description
The acctcom command reads process accounting records from files specified by the File parameter from
standard input or from the /var/adm/pacct file. Then the acctcom command writes the records you
request to standard output. This command is stored in the /usr/sbin/acct directory, for access by all users.
If you specify a File parameter, the acctcom command reads each file chronologically by process
completion time. Usually, the /var/adm/pacct file is the current file that you want the acctcom command
to examine. Because the ckpacct procedure keeps this file from growing too large, a busy system may
have several pacct files. All but the current file have the path name /var/adm/pacct?, where ? (question
mark) represents an integer.
Each record represents one completed process. The default display consists of the command name, user
name, tty name, start time, end time, real seconds, CPU seconds, and mean memory size (in kilobytes).
These default items have the following headings in the output:
COMMAND START END REAL CPU MEAN
NAME USER TTYNAME TIME TIME (SECS) (SECS) SIZE(K)
If a process was run by the root user, the process name is prefixed with a # (pound sign). If a process is
not assigned to a known workstation ( for example, when the cron daemon runs the process), a ?
(question mark) appears in the TTYNAME field.
Notes:
1. The acctcom command only reports on processes that have finished. Use the ps command to
examine active processes.
2. If a specified time is later than the current time, it is interpreted as occurring on the previous day.
Security
Access Control: This command should grant execute (x) access to all users.
Flags
-a Shows some average statistics about the processes selected. The statistics are displayed after
the output records.
-b Reads backwards, showing the most recent commands first. This flag has no effect when the
acctcom command reads standard input.
-c Classname Selects processes belonging to the specified class.
Note: Accounting data cannot be retrieved for a deleted class.
-C Seconds Shows only processes whose total CPU time (system time + user time) exceeds the value
specified by the Seconds variable.
-e Time Selects processes existing at or before the specified time. You can use the current locale to
specify the order of hours, minutes, and seconds. The default order is hh:mm:ss.
-E Time Selects processes ending at or before the specified time. You can use the current locale to
specify the order of hours, minutes, and seconds. The default order is hh:mm:ss. If you specify
the same time for both the -E and -S flags, the acctcom command displays the processes that
existed at the specified time.
-f Displays two columns related to the ac_flag field of the acct.h file: the first indicates use of the
fork command to create a process, the second indicates the system exit value. Refer to the acct
structure described in the acct file format in AIX 5L Version 5.3 Files Reference.
-g Group Selects processes belonging to the specified group. You can specify either the group ID or the
group name.
-h Instead of mean memory size, shows the fraction of total available CPU time consumed by the
process (hog factor). This factor is computed as:
(total CPU time) / (elapsed time)
-H Factor Shows only the processes that exceed the value of the Factor parameter. This factor, called the
hog factor, is computed as:
(total CPU time) / (elapsed time)
-i Displays columns showing the number of characters transferred in read or write operations (the
I/O counts).
Examples
1. To display information about processes that exceed 2 seconds of CPU time, enter:
/usr/sbin/acct/acctcom -O 2 < /var/adm/pacct
Related Information
The ed command, ps command, runacct command, su command.
For more information about the accounting system, the preparation of daily and monthly reports, and the
accounting files, see the System accounting in Operating system and device management.
Setting up an accounting subsystem in Operating system and device management describes the steps you
must take to establish an accounting system.
Purpose
Performs connect-time accounting.
Syntax
acctcon1 [ -l File ] [ -o File ] [ -p ] [ -t ] [ -X ]
acctcon2 [ -X ]
Description
acctcon1
The acctcon1 command is called by the runacct command to convert a sequence of login and logoff
records (read from standard input) to a sequence of login session records (written to standard output).
Input is normally redirected from the /var/adm/wtmp file. The input file can be a file other than
/var/adm/wtmp, as long as it is in the correct format.
The acctcon1 command also maintains a list of ports on which users are logged in. When the acctcon1
command reaches the end of its input, the command writes a session record for each port that still
appears to be active. Unless the -t flag is used, the acctcon1 command assumes that input is a current
file and uses the current time as the ending time for each session still in progress.
The summary file generated with the -l flag helps an administrator track line usage and identify bad lines.
All hang-ups, terminations of the login command, and terminations of the login shell cause the system to
write logoff records. Consequently, the number of logoffs is often much higher than the number of
sessions.
acctcon2
The acctcon2 command, also called by the runacct command, converts a sequence of login session
records produced by the acctcon1 command into connect-time total accounting records. These records
are merged with other total accounting records by the acctmerg command to produce a daily report.
Flags
Note: The following flags are used with the acctcon1 command.
-l File (lowercase L) Writes a line-usage summary file showing the line name, the number of minutes
used, the percentage of total elapsed time, the number of sessions charged, the number of
logins, and the number of logoffs. If you do not specify a file name, the system creates the
information in the /var/adm/acct/nite/lineuse file.
-o File Writes to the specified file an overall record for the accounting period, giving starting time,
ending time, number of restarts, and number of date changes. If you do not specify a file name,
the system creates the /var/adm/acct/nite/reboots file.
-p Displays only input. Line name, login name, and time are shown in both numeric and date/time
formats. Without the -p flag specified, the acctcon1 command would display input, converting
input to session records, and write reports.
-t Uses the last time found in the input as the ending time for any current processes. This, rather
than current time, is necessary in order to have reasonable and repeatable values for files that
are not current.
-X Prints and processes all available characters for each user name instead of truncating to the
first 8 characters.
Note: The following flag can be used with both the acctcon1 and acctcon2 commands.
Security
Access Control: These commands should grant execute (x) access only to members of the adm group.
Examples
1. To convert a sequence of login records (in the /var/adm/wtmp file) to a sequence of login session
records (stored in the /var/adm/logsess file), include the following in a shell script:
acctcon1 -t -l/var/adm/acct/nite/lineuse \
-o/var/adm/acct/nite/reboots \
</var/adm/wtmp > /var/adm/logsess
The login session reports show an ending time that corresponds with the last time input was provided.
Two reports are generated: a line-usage summary file named /var/adm/acct/nite/lineuse, an overall
record for the accounting period, reported in the /var/adm/acct/nite/reboots file.
Files
/usr/sbin/acct/acctcon1 Contains the acctcon1 command.
/usr/sbin/acct/acctcon2 Contains the acctcon2 command.
/var/adm/wtmp Contains connect-time accounting data, including login, logout, and
shutdown records.
Related Information
The acctmerg command, fwtmp, acctwtmp, or wtmpfix command, init command, login command,
runacct command.
For more information about the Accounting System, the preparation of daily and monthly reports, and the
accounting files, see the System accounting in Operating system and device management.
Setting up an accounting subsystem in Operating system and device management describes the steps you
must take to establish an accounting system.
acctctl Command
Purpose
Controls advanced accounting.
Syntax
acctctl fadd file size
acctctl on
acctctl off
acctctl
Description
The administration of Advanced Accounting (AACCT) is organized around the following high level tasks,
which are mostly performed by the acctctl command.
v Manage Accounting Data Files.
v Manage Project Definitions and Assignments.
v Manage Transactions.
v Manage Advanced Accounting Subsystem.
Messages are sent alerting the administrator to the status of files, so that he can avoid these types of
problems before they occur. The best approach is to allocate sufficient file space up front. Messages are
sent, when a file approaches the full state, and when the system automatically switches to another file.
Messages are sent by way of the syslog facility and email. These subsystems have to be correctly
configured in order to receive messages.
When the system runs out of accounting files, it internally buffers accounting data, so data is not
immediately lost. If the administrator does not respond in time and data is lost, then the system internally
maintains some statistics about the outage, which it logs to the accounting subsystem, after the condition
has been corrected.
Before starting AACCT, the system administrator should create the accounting files that will be needed on
the system. The number and size of these files is workload dependent, so the administrator should choose
values that are appropriate for the specific installation. The only recommendation is that at least two files
be created, so that AACCT can remain active at all times.
acctctl fadd file size Allocates and defines an accounting file with specified filename
and size. The size is in megabytes.
acctctl frm file Removes the specified accounting file from the accounting
subsystem. This will not remove the file from the file system.
acctctl freset file Indicates that the specified file can now be reused by the
accounting subsystem.
acctctl fquery [file] Queries the state and current utilization of the specified file, if
supplied, or all accounting files otherwise.
All files must be fully qualified path names. When creating a file, ensure that the file system has enough
space.
Managing Transactions
The third task, Manage Transactions, is designed to control the type of accounting data that is produced,
which is configuration dependent, because applications and middleware can provide transactions. The
following types of accounting are supported on all systems:
v Process
v Disk
v Network interfaces
v File systems
v System (provides global CPU and memory use)
Administrative control over these sources of accounting data is provided by enabling or disabling the
accounting records that they produce. Each accounting record is assigned a unique identifier, so that
report and analysis commands can apply the appropriate templates when processing the accounting file.
These identifiers also serve to name the different types of accounting that is supported and are specified
as parameters to the transaction specific commands. Identifiers are listed in the sys file.
acctctl trquery [trid] Queries the state and name of the specified trid, if
supplied, or of all trids, otherwise.
acctctl tron trid Enables the specified transaction.
acctctl troff trid Disables the specified transaction.
Not all transaction identifiers can be disabled, because some of them are derived types and are dependent
on other transactions. For example, the process aggregation record is dependent on the process record,
so it can’t be disabled by itself. Aggregation can be enabled or disabled, and process accounting can be
enabled or disabled, but the transaction identifier that corresponds to the aggregated process record can’t
be disabled. Aggregation is a convenience in the sense that it sums up data internally, so that fewer
records are produced. In some cases, data aggregation is provided to simplify data management.
Exit Status
This command returns the following exit values:
Security
Root authority is required to use this command.
Data files are created by this command. These files are owned by root, but are readable by members of
the adm group.
Examples
1. To display status, type:
acctctl
Location
/usr/bin/acctctl
Files
/var/aacct Default directory for accounting data files.
/var/aacct/acctdata Default accounting data file.
Related Information
The projctl command in AIX 5L Version 5.3 Commands Reference, Volume 4.
Application transactions are supported through the Application Response Measurement (ARM) APIs, which
are documented in Application Response Measure (ARM) Issue 4.0 - C Binding, The Open Group. This
document is available at [Link]
Purpose
Performs disk-usage accounting.
Syntax
/usr/sbin/acct/acctdisk
Description
The acctdisk and acctdusg commands are called by the dodisk command to perform disk-usage
accounting. Usually, this procedure is initiated when the cron daemon runs the dodisk command.
Normally, the output of the diskusg command becomes the input of the acctdisk command. If a more
thorough but slower version of disk accounting is needed, use the dodisk -o command to call the
acctdusg command instead of the diskusg command.
Accounting is only done for files on the local file system for local users. System administrators who want to
count remote users (such as YP clients or diskless clients) should use the acctdusg -p command.
acctdisk
The acctdisk command reads the output lines of the diskusg or acctdusg commands from standard
input, converts each individual record into a total accounting record, and writes the records to standard
output. These records are merged with other accounting records by the acctmerg command to produce
the daily accounting report.
The acctdusg command reads a list of files from standard input (usually piped from a find / -print
command), computes the number of disk blocks (including indirect blocks) allocated to each file owner,
and writes an individual record for each user to standard output. By default, the command searches for
login names and numbers in the /etc/passwd file. You can search other files by specifying the -p File flag
and variable. Each output record has the following form:
uid login #blocks
The #blocks value is the number of 1KB blocks utilized by the user.
Flags
-p File Searches the specified file for login names and numbers, instead of searching the /etc/passwd
file.
-u File Places, in the specified file, records of the file names that are exempt from charges.
-X Turns on long username support.
Security
Access Control: These commands should grant execute (x) access only to members of the adm group.
Examples
1. To start normal disk accounting procedures, add a line similar the following to a crontab file so that the
cron daemon runs disk accounting commands automatically:
0 2 * * 4 /usr/sbin/acct/dodisk
In this example, the dodisk procedure runs at 2 a.m. (0 2) every Thursday (4) and the dodisk
procedure calls the diskusg and acctdisk commands to write disk usage records to the
/usr/adm/acct/nite/dacct file.
2. To start a thorough disk accounting procedure, add a line similar the following to a crontab file so that
the cron daemon runs disk accounting commands automatically:
0 2 * * 4 /usr/sbin/acct/dodisk -o
In this example, the dodisk procedure runs at 2 a.m. (0 2) every Thursday (4) and the dodisk
procedure calls the acctdusg and acctdisk commands to write disk usage records to the
/var/adm/acct/nite/dacct file.
Files
/usr/sbin/acct/acctdisk Contains the acctdisk command.
/usr/sbin/acct/acctdusg Containsthe acctdusg command.
/etc/passwd Contains the basic attributes of user.
/usr/sbin/acct Directory holding all accounting commands.
Related Information
The acctmerg command, diskusg command, dodisk command, runacct command.
System accounting in Operating system and device management provides more information about the
accounting system, the preparation of daily and monthly reports, and the accounting files.
Setting up an accounting subsystem in Operating system and device management describes the steps you
must take to establish an accounting system.
acctmerg Command
Purpose
Merges total accounting files into an intermediary file or a daily report.
Syntax
/usr/sbin/acct/acctmerg [ -a [ Specification ] ] [ -h [ Specification ] ] [ -i [ Specification ] ] [
-p [ Specification ] ] [ -q Filename ] [ -v [ Specification ] ] [ -X ] [ -t ] [ -u ] [ File ... ]
Description
The acctmerg command merges process, connect-time, fee, disk-usage, and queuing (printer) total
accounting records (in tacct binary or tacct ASCII format, tacctx binary, or tacctx ASCII format) and then
writes the results to standard output. (See the tacct structure in the acct File Format for a description of
the total accounting format or /usr/include/sys/tacct.h for a description of the tacctx format). The
acctmerg command reads the total accounting records from standard input and from the additional files
(up to nine) specified by the File parameter. The acctmerg command then merges the records by identical
keys, usually a user ID and name. To facilitate storage, the acctmerg command writes the output in binary
format unless you use either the -a, -v, or -p flag.
The acctmerg command is called by the runacct command to produce either an intermediate report when
one of the input files is full, or to merge the intermediate reports into a cumulative total. The intermediate
report is stored in the /var/adm/acct/nite(x)/daytacct file. The cumulative report is stored in the
/var/adm/acct/sum(x)/tacct file. The cumulative total is the source from which the monacct command
produces the ASCII-format monthly summary report. The monthly summary report is stored in the
/var/adm/acct/fiscal file.
The Specification variable allows you to select input or output fields, as illustrated in Example 1. A field
specification is a comma-separated list of field numbers, in the order specified in the tacct(x) structure in
the acct File Format. Field ranges may be used, with array sizes taken into account, except for the
ta_name characters. In the following example:
-h2-3,11,15-13,2
The -h flag causes column headings to display for the following types of data, in this order:
v login name (2)
v prime CPU (3)
v connect time (11)
v fee (15)
v queuing system (14, as implied in the range)
v disk usage data (13)
v the login name again (2)
The default displays all fields, otherwise specified as 1-18 or 1-, and produces wide output lines containing
all the available accounting data.
Flags
-a[Specification] Produces output in the form of ASCII records.
-h[Specification] Displays column headings. This flag implies the -a flag, but is effective with -p or
-v.
-i[Specification] Expects input files composed of ASCII records, which are converted to binary
records.
-p[Specification] Displays input without processing. The output is in ASCII format.
-q Filename Reads the specified qacct file (accrec.h file format) and produces output records
sorted by user ID and user name. These records contain the user ID, user name,
and number of pages printed.
-t Produces a single record that contains the totals of all input.
-u Summarizes by user ID rather than by user name.
-v[Specification] Produces output in ASCII format, with more precise notation for floating-point
numbers.
-X Prints and processes all available characters for each user name instead of
truncating to the first 8 characters.
Security
Access Control: This command should grant execute (x) access only to members of the adm group.
Examples
1. To merge disk accounting file dacct with field specification -i1-2,13,18 into an existing total
accounting file, tacct, enter:
acctmerg -i1-2,13,18 <dacct | acctmerg tacct >output
The acctmerg command reads the field specifications for the user ID, login name, number of blocks,
and number of disk samples (i1-2,13,18) from the dacct file, merges this information with a tacct
record, and writes the result to standard output.
Now edit the file [Link] as desired. This command redirects the content of [Link] to [Link],
with the output in ASCII format.
3. To redirect [Link] to [Link], with the output in binary record format, enter the following command:
Files
/usr/sbin/acct/acctmerg Contains the acctmerg command.
/usr/include/sys/acct.h Contains the acct and tacct file formats.
/var/adm/acct/nite/daytacct Contains an intermediate daily total accounting report in binary
format.
/var/adm/acct/sum/tacct Contains the cumulative total accounting report for the month in
binary format.
/var/adm/acct/fiscal Contains the monthly accounting summary report, produced
from the records in the /var/adm/acct/sum/tacct file.
Related Information
The acctcms command, acctcom command, acctcon1 or acctcon2 command, acctdisk command,
acctprc1, acctprc2, or accton command, fwtmp command, runacct command.
Setting up an accounting subsystem in Operating system and device management describes the steps you
must take to establish an accounting system.
Purpose
Performs process-accounting procedures.
Syntax
/usr/sbin/acct/acctprc1 [ InFile ]
/usr/sbin/acct/acctprc2 [ -X ]
/usr/sbin/acct/accton [ OutFile ]
Description
The three acctprc commands, acctprc1, acctprc2, and accton, are called by the runacct command to
perform process-accounting shell procedures.
If specified, the InFile parameter contains a list of login sessions in utmp format, sorted by user ID and
login name. If the File parameter is not specified, acctprc1 gets login names from the/etc/passwd
password file. The information in the InFile parameter helps distinguish among different login names that
share the same user ID.
The acctprc2 command reads (from standard input) the records written by the acctprc1 command,
summarizes them by user ID and name, and writes the sorted summaries to standard output as total
accounting records.
When the accton command is used without parameters, process accounting is turned off. If you specify
the OutFile parameter (an existing file), process accounting is turned on, and the kernel adds records to
that file. You must specify the OutFile parameter for process accounting to start. The OutFile parameter is
not created by the accton command. The file specified by the OutFile parameter must already exist with
the proper group, owner, and permissions. Many shell scripts expect the /var/adm/pacct file.
Flags
-X Process all available characters for each use rname instead of truncating to the first 8 characters. This
flag also causes the acctprc2 command to produce tacctx formatted binary records instead of tacct
binary records.
Note: This flag can only be used with the acctprc2 command.
Security
Access Control: These commands should grant execute (x) access only to members of the adm group.
Examples
1. To add a user name to each process-accounting record in a binary file and convert the records to an
ASCII file named [Link], enter the following commands or use the lines in a shell script:
/usr/sbin/acct/acctprc1 < /var/adm/pacct >[Link]
2. To produce a total accounting record of the ASCII output file in example 1, enter the following
commands or use the lines in a shell script:
/usr/sbin/acct/acctprc2 < [Link] > \
/var/adm/acct/nite/daytacct
The resulting file is a binary total accounting file in tacct format, containing individual records sorted by
user ID. The file /var/adm/acct/nite/daytacct is merged with other total accounting records by the
acctmerg command to produce the daily summary record in the /var/adm/acct/sum/tacct file.
3. To turn off process accounting, enter:
/usr/sbin/acct/accton
Files
/usr/sbin/acct/acctprc1 Contains the acctprc1 command.
/usr/sbin/acct/acctprc2 Contains the acctprc2 command.
/usr/sbin/acct/accton Contains the accton command.
/etc/accton Symbolic link to the actual accton command directory.
Related Information
The acctmerg command,runacct command.
For more information about the accounting system, the preparation of daily and monthly reports, and the
accounting files, see the System accounting in Operating system and device management.
Setting up an accounting subsystem in Operating system and device management describes the steps you
must take to establish an accounting system.
acctrpt Command
Purpose
Generates advanced accounting subsystem data reports.
Syntax
acctrpt [ -f filename ] [ -F ] [ -U uid ] [ -G gid ] [ -P projID ] [ -C command ] [ -b begin_time ] [ -e end_time
] [ -p projfile ] [ -n ]
Description
The acctrpt command displays the advanced accounting statistics. advanced accounting subsystem
supports process accounting, LPAR accounting, and transaction accounting.
For process accounting, users can generate accounting reports by projects, by groups, by users, by
commands, or by a combination of these four identifiers. The command arguments -U, -G, -P, and -C
command arguments are used to generate process accounting reports. The order in which these
arguments are specified affects the order in which the data is displayed in the report. For example, the
acctrpt -U ALL -P ALL command sorts by UID first and project second.
For LPAR accounting, users can generate accounting reports that describe the system-level use of
resources, such as processors, memory, file systems, disks, and network interfaces. The system
accounting interval must be enabled to collect accounting statistics for system resources. The -L command
argument is used to generate LPAR accounting reports.
Note: The -L argument provides OS image level statistics, so it can also be used on systems that are not
LPAR systems.
If the -U, -G, -P, -C, -L, and -T command arguments are not specified, individual process accounting
records are displayed.
Flags
-b begin_time Specifies the begin time of an interval. The begin_time
parameter is a 10-character string in the MMDDhhmmyy
format, where MM is month, DD is day, hh is hour, mm is
minute, and yy is the last 2 digits of the year. All
characters are numeric. If begin_time is not specified, all
encountered records that were written before end_time
are considered. If neither end_time or begin_time is
specified, all records are considered.
-C command Displays process accounting statistics for the specified
command. More than one command name can be
specified using a comma-separated list. Only the first 12
characters of the base command name are considered. To
display all commands, specify -C ALL.
-c Displays the project definitions in human readable format.
-e end_time Specifies the end time of an interval. The end_time
parameter is a 10-character string in the MMDDhhmmyy
format, where MM is month, DD is day, hh is hour, mm is
minute, and yy is the last 2 digits of the year. All
characters are numeric. If end_time is not specified, all
encountered records that were written after begin_time are
considered. If neither end_time or begin_time is specified,
all records are considered.
-f filename Specifies the path name of the accounting data file to be
used. More than one file can be specified using a
comma-separated list. If the -f flag is not specified, the
/var/aacct/aacctdata file is used by default.
-F Displays information about the specified accounting data
file. The report includes the host name, partition name,
machine model, and serial number of the system where
the accounting data file was generated.
-G gid Displays process accounting statistics for the specified
GIDs. More than one GID can be specified using a
comma-separated list. To display all GIDs, specify -G ALL.
Exit Status
0 Successful completion.
>0 An error occurred.
Examples
1. To generate a file header report from the /var/aacct/acctdata data file, type:
acctrpt -F -f /var/aacct/acctdata
2. To generate process accounting report by Users from the /var/aacct/acctdata data file, type:
acctrpt -U ALL -f /var/aacct/acctdata
3. To generate a process accounting report for user ID 256 and user ID 257 and command uname from
the /var/aacct/acctdata data file, type:
acctrpt -U 256 257 -C uname -f /var/aacct/acctdata
4. To generate a process accounting report by projects and by users from the/var/aacct/acctdata data
file, type:
acctrpt -P ALL -U ALL -f /var/aacct/acctdata
5. To generate CPU and Memory statistics from the /var/aacct/acctdata data file, type:
Standard Output
Based on the -f option, the acctrpt command displays the following values in the File Header report.
Based on one or more of the -P, -G, -U, or -C options, the acctrpt command displays the following values
in the Process Accounting report.
Based on the -L cpumem option, the acctrpt command displays the following values in the CPU and
Memory LDAP Accounting report.
Based on the -L filesys option, the acctrpt command displays the following values in the File Systems
LPAR Accounting report.
Based on the -L netif option, the acctrpt command displays the following values in the Network Interfaces
LPAR Accounting report.
Based on the -L disk option, the acctrpt command displays the following values in the Disks LPAR
Accounting report.
Based on the -L vtarget option, the acctrpt command displays the following values in the VSCSI Targets
LPAR Accounting report.
Based on the -L vclient option, the acctrpt command displays the following values in the VSCSI Clients
LPAR Accounting report.
Note: Some of the transaction records displayed by -U, -G, -P and -C cannot be aggregated. For
example, the transaction records that belong to the transaction ID TRID_agg_proc cannot be
aggregated on group IDs and command names because these transaction records do not have the
respective fields. For such records, the acctrpt command displays a * (asterisk) character in the
command name field and a value of -2 in the group ID field. It is an indication that these records
are not aggregated and the caller has to look up for the command name.
Files
/usr/bin/acctrpt Contains the acctrpt command.
/var/aacct/acctdata Contains the default accounting data file.
Related Information
The libaacct.a library interfaces in the in AIX 5L Version 5.3 Technical Reference: Base Operating System
and Extensions Volume 1.
acctwtmp Command
Purpose
Manipulates connect-time accounting records by writing a utmp record to standard output.
Syntax
/usr/sbin/acct/acctwtmp ″Reason″
Description
The acctwtmp command is called by the runacct command to write a utmp record to standard output.
The standard output includes the current date and time, plus a Reason string of 11 characters or less that
you must enter.
Flags
None.
Parameters
Reason String of 11 characters or less.
Files
/usr/sbin/acct/accwtmp Contains the acctwtmp command.
/var/adm/wtmp Contains records of date changes that include an old date and a new
date.
/usr/include/utmp.h Contains history records that include a reason, date, and time.
Related Information
The acctcon1 or acctcon2 command, acctmerg command, fwtmp command, runacct command,
wtmpfix command.
aclconvert Command
Purpose
Converts the access control information of a file system object from one type to another.
Syntax
aclconvert [ -R ] [-I] -t ACLType File
Description
The aclconvert command converts the access control information (ACL) of the file system object specified
by the File parameter to another type as specified by ACLType argument input to command. The
conversion could fail if the target ACL type is not supported by the file system where File exists. Also note
that the ACL conversion will take place with the help of ACL type specific algorithm and invariably the
conversion will be approximate. So the conversion could result in potential loss of access control and it is
essential that the user of this command be sure that the converted ACL satisfies the necessary access
restrictions. The user might manually review the access control information after the conversion for the file
system object to ensure that the conversion was successful and fulfills the requirements of the desired
access control.
Flags
-I Does not display any warning messages.
-R Recursive option allows the user to convert ACL types for all the file system objects under a
directory structure to the desired ACL type.
-t ACLType Specifies the target ACL type to which the File’s ACL type will be converted. The conversion will
succeed only if the file system in question supports the ACL type requested. If the conversion is
lossy, a warning message will be issued. This kind of warning messages can be suppressed
using -I option.
0 The command executed successfully and all requested changes were made.
>0 An error occurred.
Security
Access Control: This command should be a standard user program and have the trusted computing base
attribute.
Auditing Events: If the auditing subsystem has been properly configured and is enabled, the aclconvert
command will generate the following audit record (event) every time the command is executed:
Event Information
FILE_Acl Lists access controls.
Examples
1. To convert the access control information for the status file to AIXC ACL type, type:
aclconvert -t AIXC status
This converts all file system objects under dir1 to the ACL type AIXC..
Location
/usr/bin/aclconvert
Files
/usr/bin/aclconvert Contains the aclconvert command.
Related Information
The acledit command, aclput command, chmod command.
The Auditing Overview in Security explains more about audits and audit events.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
acledit Command
Purpose
Edits the access control information of a file.
Description
The acledit command lets you change the access control information of the file specified by the FileObject
parameter. The command displays the current access control information and lets the file owner change it
with the editor specified by the EDITOR environment variable. Before making any changes permanent, the
command asks if you want to proceed.
Note: The EDITOR environment variable must be specified with a complete path name; otherwise, the
acledit command will fail. The maximum size of the ACL data is dependent on the ACL type.
The access control information displayed depends on the ACL type associated with the file system object.
Information typically includes access control entries displayed for owner and others. Also, file mode bits
associated with the object could be displayed.
Note: If the acledit command is operating in a trusted path, the editor must have the trusted
process attribute set.
Flags
-t This optional input specifies the ACL type in which the ACL data will be stored at the end of the
ACL editing process. If no option is specified, then the ACL currently associated with the file
system object will be edited in its ACL type format. If an ACL type is specified with this flag, then
it is assumed that user is trying to modify the current ACL type and store the ACL in a new ACL
type format. When this flag is specified and the ACL type does not match the type that exists
currently, it is expected that user will modify the contents of the ACL data to format into the new
ACL type specific format before saving.
-v Displays the ACL information in Verbose mode. Comment lines will be added to explain more
details about the ACL associated with the FS object. These comment lines are generated when
the command is executed and do not reside anywhere persistently. Hence, any modifications to
the same will be lost when acledit is exited.
Security
Access Control: This command should be a standard user command and have the trusted computing
base attribute.
Files Accessed:
Mode File
x /usr/bin/aclget
x /usr/bin/aclput
Event Information
FILE_Acl Lists access controls.
See ″Setting up Auditing″ in Security for more details about how to properly select and group audit events,
and how to configure audit event data collection.
Examples
To edit the access control information of the plans file, enter:
acledit plans
Files
/usr/bin/acledit Contains the acledit command.
Related Information
The aclget command, aclput command, auditpr command, chmod command.
The Auditing Overview in Security explains more about audits and audit events.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
aclget Command
Purpose
Displays the access control information of a file.
Syntax
aclget [ -o OutAclFile ] [ -v ]FileObject
Description
The aclget command writes the access control information of the file specified by the FileObject parameter
to standard output or to the file specified by the OutAclFile parameter.
The information that you view depends on the ACL type and typically includes the Access Control Entries
(ACEs) depicting the access rights of the users in the system, including the owner of the file object.
Flags
-o OutAclFile Specifies that the access control information be written to the file specified by the OutFile
parameter.
-v Displays the ACL information in Verbose mode. Comment lines will be added to explain
more details about the ACL associated with the FS object. These comment lines are
generated when the command is executed and do not reside anywhere persistently.
Examples
1. To display the access control information for the status file, enter:
aclget status
An access control list appears, similar to the example in Access Control Lists.
2. To copy the access control information of the plans file to the status file, enter:
aclget plans | aclput status
This copies the access control information. In most cases, the ACL type associated with plans will be
the ACL type of ACL associated with the target status. However, it is possible that the target file
system does not support the ACL type associated with file system object plans. In this case, the
operation will fail and an error message is displayed. The target will retain its original associated ACL.
3. To save the access control information of the plans file in the acl1 file to edit and use later, enter:
Files
/usr/bin/aclget Contains the aclget command.
Related Information
The acledit command, aclput command, chmod command.
The Auditing Overview in Security explains more about audits and audit events.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
aclgettypes Command
Purpose
Gets ACL types supported by a file system path.
Description
The aclgettypes command retrieves the list of ACL types supported for a given file system path and
displays the same. The default ACL type for the file system instance concerned will be displayed as the
first entry. See Security Guide more information regarding supported ACL types.
Exit Status
This command returns the following exit values:
0 The command executed successfully and all requested changes were made.
>0 An error occurred.
Security
Access Control: This command should be a standard user program and have the trusted computing
base attribute.
Examples
1. To display ACL types supported by a file system instance that contains path /home/plan1, type:
aclgettypes /home/plan1
Location
/usr/bin/aclgettypes
Files
/usr/bin/aclgettypes Contains the aclgettypes command.
Related Information
The acledit command, aclput command, chmod command.
The Auditing Overview in Security explains more about audits and audit events.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
aclput Command
Purpose
Sets the access control information of a file.
Syntax
aclput [ -i inAclFile ] [ -R ] [ -t acl_type ] [ -v ]FileObject
Note: If you are reading from standard input your entries must match the expected format of the access
control information or you will get an error message. Use the Ctrl-D key sequence to complete the
session.
Flags
-i inAclFile Specifies the input file for access control information. If the access control information in the file
specified by the InFile parameter is not correct, when you try to apply it to a file, an error
message preceded by an asterisk is added to the input file.
Note: The size of the ACL information depends on the ACL type.
-R Applys ACL to this directory and its children file system objects recursively.
-t ACL_type Specifies the ACL type of the ACL information being displayed. If this option is not provided the
actual ACL data in its original ACL type will be displayed.
-v Verbose option. This option displays many comment lines as part of the ACL data display. This
could help in understanding the details of complex ACL types.
Security
Access Control: This command should be a standard user program and have the trusted computing
base attribute.
Auditing Events: If the auditing subsystem has been properly configured and is enabled, the aclput
command will generate the following audit record (event) every time the command is executed:
Event Information
FILE_Acl Lists file access controls.
See ″Setting up Auditing″ in Security for more details about how to properly select and group audit events,
and how to configure audit event data collection.
Examples
1. To set the access control information for the status file with information from standard input, enter:
aclput status
attributes: SUID
This stores the access control information for the plans file in the acl file. Edit the information in the
acl file, using your favorite editor. Then, enter:
This second command takes the access control information in the acl file and puts it on the status
file.
Files
/usr/bin/aclput Contains the aclput command.
Related Information
The acledit command, aclget command, auditpr command, chmod command.
The Auditing Overview in Security explains more about audits and audit events.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
adb Command
Purpose
Provides a general purpose debug program.
Syntax
adb [ -k ] [ -l Directory ] [ -w ] [ ObjectFile [ CoreFile ] ]
Description
The adb command provides a debug program for programs. With this debug program, you can examine
object and core files and provide a controlled environment for running a program.
Normally, the ObjectFile parameter is an executable program file that contains a symbol table. If the
ObjectFile parameter does not contain a symbol table, the symbolic features of the adb command cannot
be used, although the file can still be examined. The default for the ObjectFile parameter is [Link].
The CoreFile parameter is a core image file produced by running the ObjectFile parameter. The default for
the CoreFile parameter is core.
where Address and Count are expressions. The default for the Count expression is a value of 1. If the
Address expression is specified, the . (period) variable is set to Address.
The interpretation of an address depends on the context in which it is used. If a subprocess is being
debugged, addresses are interpreted in the usual way in the address space of the subprocess.
Enter more than one command at a time by separating the commands with a ; (semicolon).
See the adb Debug Program Overview in AIX 5L Version 5.3 General Programming Concepts: Writing and
Debugging Programs for detailed information.
Note: If the object file does not contain the symbol table, the adb command will not be able to show the
value of static, automatic, and external variables of a program.
Flags
-k Causes kernel mapping.
-l Directory Specifies a directory where files to be read with $< or $<< are sought. The default is the
/usr/ccs/bin/adb file.
-w Opens the ObjectFile and the Corefile parameters for reading and writing. If either file does
not exist, this flag creates the file.
Return Values
The adb debug program is printed when there is no current command or format. The adb command
indicates such things as inaccessible files, syntax errors, and abnormal termination of commands. Exit
status is a value of 0, unless the last command was unsuccessful or returned non-zero status.
Files
/dev/mem Provides privileged virtual memory read and write access.
[Link] Provides common assembler and link editor output.
core Contains an image of a process at the time of an error.
Related Information
The cc command, dbx command.
addbib Command
Purpose
Creates or extends a bibliographic database.
Syntax
addbib [ -a ] [ -p PromptFile ] Database
Description
The addbib command uses a series of prompts to guide the user through creating or extending a
bibliographic database. The user can define responses to these prompts. All default prompts and
instructions are contained in the refer message catalog.
The first prompt is Instructions?. If the answer is affirmative, you can receive directions.
If the answer is negative or if you press the Enter key, you cannot receive directions. The addbib
command then prompts for various bibliographic fields, reads responses from the terminal, and sends
output records to the database specified by the Database parameter.
Pressing the Enter key (a null response) means to omit a particular field. Typing a - (minus sign) means to
return to the previous field. A trailing backslash allows a field to be continued on the next line. The
repeating Continue? prompt allows you to resume, to quit the current session, or to edit the database. To
resume, type the defined affirmative answer or press the Enter key. To quit the current session, type the
defined negative answer.
To edit the database, enter any system text editor (vi, ex, edit, ed).
Flags
-a Suppresses prompting for an abstract. Prompting for an abstract is the default. Abstracts are
ended by pressing a Ctrl-D key sequence.
The following are the most common key letters and their meanings. The addbib command
insulates you from these key letters, since it gives you prompts in English. If you edit the
bibliography file later, you need to know this information.
%A Author’s name
%B Book containing article referenced
%C City (place of publication)
%D Date of publication
%E Editor of book containing article referenced
%F Footnote number or label (supplied by the refer command)
%G Government order number
%H Header commentary, printed before reference
%I Issuer (publisher)
%J Journal containing article
%K Keywords to use in locating reference
%L Label field used by -k flag of the refer command
%M Bell Labs memorandum (undefined)
%N Number within volume
%O Other commentary, printed at end of reference
%P Page numbers
%Q Corporate or foreign author (unreversed)
%R Report, paper, or thesis (unpublished)
%S Series title
%T Title of article or book
%V Volume number
%X Abstract used by the roffbib command, not by the refer command
%Y,Z Ignored by the refer command.
Note: Except for the %A key letter, each field should be given just once. Only relevant fields
should be supplied.
Examples
The following is an example of a bibliography file:
%A Bill Tuthill
%T Refer - A Bibliography System
%I Computing Services
%C Berkeley
%D 1982
%O UNIX 4.3.5.
Related Information
The indxbib command, lookbib command, refer command, roffbib command, sortbib command.
Purpose
Adds one or more nodes to a peer domain definition.
Syntax
addrpnode [−c] [−h] [−TV] node_name1 [node_name2 ... ]
Description
Before running addrpnode:
To set up the proper security environment, run the preprpnode command on each node that is to be
added to the peer domain.
The addrpnode command adds the specified nodes to the online peer domain in which it (addrpnode) is
run. This command must be run on a node that is online to the peer domain in which the new nodes are
to be added. Though a node can be defined in multiple peer domains, it can only be online in one peer
domain. To add one or more nodes to the peer domain, more than half of the nodes must be online.
To enable addrpnode to continue when there is an error on one of the nodes, use the -c flag.
The addrpnode command does not bring the added nodes online in the peer domain. To do this, use the
startrpnode command.
Flags
−c Continues processing the command as long as at least one node can be added to the peer
domain.
By default, if the addrpnode command fails on any node, it will fail on all nodes. The -c flag
overrides this behavior, so that the addrpnode command will run on the other nodes, even if it
fails on one node.
−f | −F { file_name | ″–″ }
Reads a list of node names from file_name. Each line of the file is scanned for one node name.
The pound sign (#) indicates that the remainder of the line (or the entire line if the # is in column
1) is a comment.
Use -f ″-″ or -F ″-″ to specify STDIN as the input file.
-h Writes the command’s usage statement to standard output.
-T Writes the command’s trace messages to standard error. For your software service organization’s
use only.
-V Writes the command’s verbose messages to standard output.
Parameters
node_name1 [node_name2 ... ]
Specifies the node (or nodes) to be added to the peer domain definition.
The node name is the IP address or the long or short version of the DNS
host name. The node name must resolve to an IP address.
Exit Status
0 The command ran successfully.
1 An error occurred with RMC.
2 An error occurred with a command-line interface script.
3 An incorrect flag was entered on the command line.
4 An incorrect parameter was entered on the command line.
5 An error occurred that was based on incorrect command-line input.
Environment Variables
CT_CONTACT
Determines the system where the session with the resource monitoring and control (RMC)
daemon occurs. When CT_CONTACT is set to a host name or IP address, the command contacts
the RMC daemon on the specified host. If CT_CONTACT is not set, the command contacts the
RMC daemon on the local system where the command is being run. The target of the RMC
daemon session and the management scope determine the resource classes or resources that are
processed.
CT_IP_AUTHENT
When the CT_IP_AUTHENT environment variable exists, the RMC daemon uses IP-based
network authentication to contact the RMC daemon on the system that is specified by the IP
address to which the CT_CONTACT environment variable is set. CT_IP_AUTHENT only has
meaning if CT_CONTACT is set to an IP address; it does not rely on the domain name system
(DNS) service.
Restrictions
This command must be run on a node that is online in the peer domain in which the new nodes are to be
added.
Implementation Specifics
This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX.
Standard Input
When the -f ″-″ or -F ″-″ flagd is specified, this command reads one or more node names from standard
input.
Standard Output
When the -h flag is specified, this command’s usage statement is written to standard output. All verbose
messages are written to standard output.
Standard Error
All trace messages are written to standard error.
Location
/usr/sbin/rsct/bin/addrpnode
Related Information
Books: RSCT: Administration Guide, for information about peer domain operations
addX11input Command
Purpose
Adds an X11 input extension record into the ODM (Object Data Manager) database.
Syntax
addX11input
Description
The addX11input command is used to add an X11 input extension record into the ODM database. When
you enter addX11input on the command line, the addX11input command requests DeviceName,
GenericName, and ModuleName values in turn. The entire record is then added to the ODM database.
The command is a root/system user command. Its action fails with a permissions error if an unauthorized
user attempts to add a record.
Error Codes
ODM could not open class Returned if the X11 Input extension records in the ODM database are
not found in the /usr/lib/objrepos directory.
Related Information
The deleteX11input command, listX11input command.
adfutil Command
Purpose
Provides the capability to merge Micro Channel information for PS/2 adapters with the Configuration
Database in AIX 5.1 and earlier.
Syntax
adfutil [ -d Device | -f File ] [ -a AdapterName | -c PS/2CardID ] [ -m FileName ... ] [ -q ]
The naming convention for an adapter description file found on the DOS formatted diskette is
@[Link] where XXXX is the PS/2CardID. If the command is invoked without arguments, the search
centers around the home directory of the default device. If no files are found in the form of @[Link],
an error message is sent to standard output and the adfutil command ends. If a single adapter description
file is found, execution is continued on that file. If multiple adapter description files are found, an error
message is written to standard output and processing ends. If the -c flag is specified, a string is built that
represents the corresponding DOS file name representation of the desired adapter description file. If this
file does not exist on the specified device and path name or default, an error message is sent to standard
output and processing ends.
When the adapter description file is found, the contents are written in the /tmp/adfnnn file where nnn is
the current process ID. This ID is removed after successful completion of the command.
Microcode files can be loaded independently of any adapter description file processing, and without
disturbing the adapters database representation. Use the -m flag to load microcode files into the
/usr/lib/microcode directory.
Attention: Micro Channel adapters require bus attribute processing beyond what is supported by the
bus configuration program, and should not be added to the system due to the possibility of adversely
effecting the configuration of other devices on the system.
Flags
-a AdapterName Searches the ODM database for candid information to form correct DOS filename for the
adapter description file. The AdapterName parameter is a valid device name.
-c PS/2CardID Identifies the PS/2CardID for the adapter. The card identifier is a four character
alpha-numeric string that is found in the root of the DOS filename of the adapter
description file. There is no default.
-d Device Identifies the Device where the adapter description file resides. The default is /dev/fd0.
-f File Identifies the file system path name for source adapter description file. If the -f flag is
specified, any microcode keyword found in the adapter description file must specify a file
system path name of the microcode source file.
-m FileName Loads only microcode files found on diskette. If the FileName parameter is specified, files
are loaded into the /usr/lib/microcode file. This is a microcode only flag.
-q Toggles off the message to insert the adapter description file diskette.
Examples
1. To search the diskette drive /dev/fd0 in the home directory for an adapter description file, enter:
adfutil
2. To read /home/owner/[Link] as an adapter description file, enter:
adfutil -f /home/owner/[Link]
3. To search the default device /dev/fd0 for the adapter description file labeled @[Link] without
interrupting execution for the insert diskette prompt, enter:
adfutil -c 0FFE -q
4. To load adapter microcode without processing adapter description file information, enter:
Alphabetical Listing of Commands 39
adfutil -m FileName
Related Information
The dosdir command.
Purpose
Creates and controls Source Code Control System (SCCS) files.
Syntax
To Create New SCCS Files
admin { -n -i[FileName ] } [ -a { User | GroupID } ] ... [ -f HeaderFlag[Value ] ... ] [ -r SID ] [ -t FileName ] [
-m ModificationRequestList ] [ -y[Comment ] ] File ...
Note: Do not put a space between a flag and an optional (bracketed) variable.
Note: Do not put a space between a flag and an optional (bracketed) variable.
Description
The admin command creates new Source Code Control System (SCCS) files or changes specified
parameters in existing SCCS files.
The admin command can change the parameters controlling how the get command builds the files that
you can edit. The parameters can also set conditions about who can access the file and which releases of
the files may be edited.
If the file specified by the File parameter exists, the admin command modifies the file as specified by the
flags. If the file does not exist and you supply the -i or -n flag, the admin command creates a new file and
provides default values for unspecified flags.
If you specify a directory name for the File parameter, the admin command performs the requested
actions on all SCCS files in that directory. All SCCS files contain the s. prefix before the file name. If you
use a - (minus sign) for the File parameter, the admin command reads standard input and interprets each
line as the name of an SCCS file. An end-of-file character ends input.
You must have write permission in the directory to create a file. All SCCS file names must have the form
[Link]. New SCCS files are created with read-only permission. The admin command writes to a
temporary x-file, which it calls [Link]. If it already exists, the x-file has the same permissions as the
original SCCS file. The x-file is read-only if the admin command must create a new file. After successful
completion of the admin command, the x-file is moved to the name of the SCCS file. This ensures that
changes are made to the SCCS file only if the admin command does not detect any errors while running.
The admin command also uses a temporary lock file (called [Link]), to prevent simultaneous updates to
the SCCS file by different users.
You can enter flags and input file names in any order. All flags apply to all the files. Do not put a space
between a flag and an optional variable (variable enclosed in bracket). Header flags can be set with the -f
flag and unset with the -d flag. Header flags control the format of the g-file created with the get command.
Flags
-a User or -a GroupID Adds the specified user to the list of users that can make sets of
changes (deltas) to the SCCS file. The User value can be either a
user name or a group ID. Specifying a group ID is the same as
specifying the names of all users in that group. You can specify
more than one -a flag on a single admin command line. If an
SCCS file contains an empty user list, anyone can add deltas. If a
file has a user list, the creator of the file must be included in the
list in order for the creator to make deltas to the file. If the User or
GroupID parameter is preceded by an ! (exclamation point),
specified users are denied permission to make deltas. For
example, enter -a !User.
-d HeaderFlag Deactivates the effects of the specified header flag within the
SCCS file. You can specify this flag only with existing SCCS files.
You can also specify more than one -d flag in a single admin
command. Refer to the list of header flags that follows to learn
more about the supported values.
-e User or -e GroupID Removes the specified user from the list of users allowed to make
deltas to the SCCS file. Specifying a group ID is equivalent to
specifying all User names common to that group. You can specify
several -e flags on a single admin command line.
-f HeaderFlag[Value ] Activates the specified header flag and value in the SCCS file.
You can specify more than one header flag in a single admin
command. There are 12 header flags. Refer to the list of header
flags that follows to learn more about the supported values. Do
not put a space between the HeaderFlag and Value variables.
-h Checks the structure of the SCCS file and compares a newly
computed checksum with the checksum that is stored in the first
line of the SCCS file. When the checksum value is not correct, the
file has been improperly modified or damaged. This flag helps you
detect damage caused by the improper use of non-SCCS
commands to modify SCCS files, as well as accidental damage.
The -h flag prevents writing to the file, so it cancels the effect of
any other flags supplied. If an error message is returned indicating
the file is damaged, use the -z flag to re-compute the checksum.
Then test to see if the file is corrected by using the -h flag again.
You can specify the -r flag only if you also specify the -i or -n flag.
Use this flag only when creating an SCCS file.
-t [FileName] Takes descriptive text for the SCCS file from the file specified by
the FileName variable. If you use the -t flag when creating a new
SCCS file, you must supply a file name. In the case of existing
SCCS files:
v Without a file name, the -t flag removes any descriptive text
currently in the SCCS file.
v With a file name, the -t flag replaces any descriptive text
currently in the SCCS file with text in the named file.
v The file name can include MBCS (multibyte character set)
characters.
Do not put a space between the flag and the FileName variable.
-y [Comment] Inserts the specified comment into the initial delta in a manner
identical to that of the delta command. Use this flag only when
you create an SCCS file. If you do not specify a comment, the
admin command inserts a line of the following form:
date and time created YY/MM/DD HH:MM:SS by Login
Header Flags
The following list contains the header flags that can be set with the -f flag and unset with the -d flag.
Header flags control the format of the g-file created with the get command.
b Lets you use the -b flag of a get command to create branch deltas.
c Number Makes the Number variable the highest release number that a get -e command can use. The
value of the Number variable must be greater than 0 and less than or equal to 9999. (The
default value is 9999.)
d SID Makes the SID variable the default delta supplied to a get command.
f Number Makes the Number variable the lowest release number that a get -e command can retrieve.
The Number variable must be greater than 0 and less than 9999. (The default value is 1.)
i [String] Treats the following informational message, issued by the get or delta command, as an error:
There are no SCCS identification keywords in the file. (cm7)
In the absence of this flag, the message is only a warning. The message is issued if no SCCS
identification keywords are found in the text retrieved or stored in the SCCS file (refer to the
get command). If a string is supplied, the keywords must match exactly the given string. The
string must contain a keyword and have no embedded newlines.
j Permits concurrent get commands for editing the same SID of an SCCS file. Use of the j
header flag allows multiple concurrent updates to the same version of the SCCS file.
lList (lowercase L) Locks the releases specified by the List variable against editing, so that a get -e
command against one of these releases fails. The list has the following syntax:
<List> : : = <Range> | <List> , <Range>
<Range> : : = SID | a
where character a in the list is equivalent to specifying all releases for the named SCCS file.
m Module Substitutes the Module variable for all occurrences of the 59 keyword in an SCCS text file
retrieved by a get command. The default Module variable is the name of the SCCS file without
the s. prefix. The module name can include MBCS (multibyte character set) characters.
n Causes the delta command to create a null delta in any releases that are skipped when a delta
is made in a new release. For example, if you make delta 5.1 after delta 2.7, releases 3 and 4
will be null. Releases 3 and 4 will be created as null delta entries in the delta table of the s. file.
The resulting null deltas can serve as points from which to build branch deltas. Without this
flag, skipped releases do not appear in the SCCS file.
q Text Substitutes the specified text for all occurrences of the keyword in an SCCS text file retrieved
by a get command.
t Type Substitutes specified type for all keywords in a g-file retrieved by a get command.
v [Program] Makes the delta command prompt for Modification Request (MR) numbers as the reason for
creating a delta. The Program variable specifies the name of an MR-number validity-checking
program. If the v flag is set in the SCCS file, the -m flag must also be used, even if its value is
null. The program name can include MBCS (multibyte character set) characters.
SCCS commands use the checksum to determine whether a file was changed since it was last used. The
only SCCS command that processes a damaged file is the admin command when used with the -h or -z
flags. The -h flag tells the admin command to compare the checksum stored in the SCCS file header
against the computed checksum. The -z flag tells the command to re-compute the checksum and store it
in the file header.
Exit Status
This command returns the following exit values:
0 Successful completion.
>0 An error occurred.
Examples
These examples use an imaginary text file called test.c and an editor such as ed to edit files.
1. First, create an ordinary SCCS file. To create an empty SCCS file named [Link].c, enter:
$ admin -n [Link].c
Using the admin command with the -n flag creates an empty SCCS file.
2. To convert an existing text file into an SCCS file, enter:
$ admin -itest.c [Link].c
There are no SCCS identification keywords in the file (cm7)
$ ls
[Link].c test.c
If you use the -i flag, the admin command creates delta 1.1 from the specified file. Once delta 1.1 is
created, rename the original text file so it does not interfere with SCCS commands:
$ mv test.c back.c
The message There are no SCCS identification keywords in the file (cm7) does not indicate an
error. SCCS writes this message when there are no identification keywords in the file. Identification
keywords are variables that can be placed in an SCCS file. The values of these variables provide
information such as date, time, SID, or file name. See the get command for an explanation of
identification keywords. If no identification keywords exist, SCCS writes the message. However, if the i
header flag is set in the s. file, this message causes an error condition. This flag is set by the user.
Give the SCCS file any name, beginning with s.. In the preceding example, the original file and the
SCCS file have the same name, but that is not necessary.
Because you did not specify a release number, the admin command gave the SCCS file an SID of
1.1. SCCS does not use the number 0 to identify deltas. Therefore, a file cannot have an SID of 1.0 or
[Link], for example. All new releases start with level 1.
3. To start the test.c file with a release number of 3.1, use the -r flag with the admin command, as
shown below, and enter:
$ admin -itest.c -r3 [Link].c
To restrict permission to change SCCS files to a specific set of user IDs, list user IDs or group ID
numbers in the user list of the SCCS file by using the -a flag of the admin command. This flag may
appear multiple times on the command line. These IDs then appear in the SCCS file header. Without
the -a flag to restrict access, all user IDs can change the SCCS files.
4. To restrict edit permission to the user ID dan, enter:
44 Commands Reference, Volume 1
$ admin -adan [Link].c
5. Check SCCS files on a regular basis for possible damage. The easiest way to do this is to run the
admin command with the -h flag on all SCCS files or SCCS directories, as follows:
$ admin -h s.file1 s.file2 ...
$ admin -h directory1 directory2 ...
If the admin command finds a file where the computed checksum is not equal to the checksum listed
in the SCCS file header, it displays this message:
ERROR [s. filename]:
1255-057 The file is damaged. (co6)
If a file was damaged, try to edit the file again or read a backup copy. After fixing the file, run the
admin command with the -z flag and the repaired file name:
$ admin -z s.file1
This operation replaces the old checksum in the SCCS file header with a new checksum based on the
current file contents. Other SCCS commands can now process the file.
Files
/usr/bin/admin Contains the SCCS admin command.
Related Information
The delta command, ed command, get command, prs command, sccshelp command, what command.
List of SCCS Commands in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging
Programs.
Source Code Control System (SCCS) Overview in AIX 5L Version 5.3 General Programming Concepts:
Writing and Debugging Programs.
aixmibd Daemon
Purpose
Provides the AIX Enterprise Management Information Base (MIB) extension subagent, for use with the
Simple Network Management Protocol (SNMP) version 3 agent, that collects data from system for
variables defined in the AIX Enterprise Specific MIB.
Syntax
aixmibd [ -f FileName ] [ -d Level ] [ -a Host ] [ -c Community ]
Description
The AIX Enterprise MIB extension subagent is a daemon, aixmibd, that collects data from system for
variables defined in the AIX Enterprise Specific MIB. The subagent receives SNMP requests and sends
data via the SNMP-DPI API for communication with the mainAIX snmpd daemon. An Enterprise
Management application or other simple application (example snmpinfo command) uses SNMP protocol to
get or set AIX MIB objects.
Another focus of the subagent is on important system traps. Traps, which are also called indications, or
notifications, are event reports and are used to decrease the length of time between when the event
happens and when it is noticed by a manager so that the event can be handled timely. Traps are
generated periodically to report the status change and operating status of the system. From analyzing the
data, a manager can determine if a device and the whole system are functioning properly and securely,
and make appropriate adjustment. For example, when the /home file system reaches the threshold 95%
(percent used size), a trap can be generated to report the event to a manager. The manager can respond
by sending an email, paging, and so on. To indicate system critical events instantly, a series of traps will
be generated by the subagent.
Note: TheAIX enterprise subagent should be started by the System Resource Controller (SRC). Entering
aixmibd at the command line is not recommended.
Flags
-a Host Causes the request to be sent to the specified host.
-c Community Specifies the community name.
-d Level Specifies the tracing/debug level. The default level is 56.
The debug levels are defined as follows:
v 8 = DPI® level 1
v 16 = DPI level 2
v 32 = Internal level 1
v 64 = Internal level 2
v 128 = Internal level 3
Add the numbers to specify multiple trace levels.
-f File Specifies a non-default configuration file.
Examples
1. In order to cause the aixmibd subagent to connect to the SNMP agent on the host ’host1’ with the
community name ’instrum’, enter the following:
startsrc -s aixmibd -a "-a host1 -c instrum"
2. Because the aixmibd subagent is controlled by SRC, it can be activated by startsrc. After the
aixmibd subagent is activated by startsrc in this example, the subagent will connect to the SNMP
agent on the host nmsu over TCP with default community name ’public’:
startsrc -s aixmibd -a "-a nmsu"
Files
/etc/[Link] Contains the configuration file for the aixmibd subagent.
/usr/samples/snmpd/aixmibd_security_readme /usr/samples/snmpd/aixmibd_security_readme contains
the example configurations for different views and
information about related security issues. Also contains
information describing how to set the variables in
/etc/[Link].
/usr/samples/snmpd/[Link] Contains the MIB definitions for the aixmibd subagent.
aixpert Command
Purpose
Aids the system administrator in setting the security configuration.
Syntax
aixpert
aixpert -c
aixpert -u [Link]
Description
The aixpert command sets a variety of system configuration settings to enable the desired security level.
For more information on which setting can be used in a typical environment, see AIX Security Expert.
Running aixpert with the only the -l flag set implements the security settings promptly without letting the
user configure the settings. For example, running aixpert -l high applies all the high-level security settings
to the system automatically. However, running aixpert -l with the -n -o filename option saves the security
settings to a file specified by the filename parameter. The user can then use the -v flag to view the file and
view the settings. The -f flag then applies the new configurations.
After the initial selection, a menu is displayed itemizing all security configuration options associated with
the selected security level. These options can be accepted in whole or individually toggled off or on. After
any secondary changes, aixpert continues to apply the security settings to the computer system.
Note: It is recommended that aixpert be rerun after any major systems changes, such as the installation
or updates of software. If a particular security configuration item is deselected when aixpert is
rerun, that configuration item is skipped.
Flags
-a The settings with the associated level security options are written in abbreviated
file format to the file specified by the -o flag.
-c Checks the security settings.
-e The settings with the associated level security options are written in expanded file
format to the file specified by the -o option.
-n The settings with the associated level security options are written only to the
/etc/security/aixpert/core/[Link] file. When used in conjunction with the
-o flag, the options are written to the file specified by the -o flag.
-o Stores security output to the file pointed to by filename. The output file has its
read and write permissions set to root as a security precaution. This file should be
protected against unwanted access.
-u [Link] Undoes the security settings that have been applied.
-v Allows for the graphical viewing of the security setting in a particular file.
Security
The aixpert command is executable only by root.
Examples
1. To start the graphical user interface to step through the security settings in wizard fashion, type:
aixpert
2. To write all of the high level security options to an output file, type:
aixpert -l high -a -o /etc/security/aixpert/plugin/[Link]
After completing this command, the output file can be edited, and specific security roles can be
commented out by enclosing them in the standard xml comment string (<-- begins the comment and
-\> closes the comment).
3. To apply the security settings from a configuration file, type:
aixpert -f /etc/security/aixpert/plugin/[Link]
4. To view the security settings that have been applied to the system, type:
aixpert -v /etc/security/aixpert/core/[Link]
Location
/usr/sbin/aixpert/
Contains the aixpert command.
Files
/etc/security/aixpert/core/[Link] Contains an xml listing of all possible security settings. Has -r--------
permissions, and requires root security.
/etc/security/aixpert/core/ Contains an xml listing of applied security.
[Link]
/etc/security/aixpert/core/[Link] Contains an xml listing of selected security settings.
/etc/security/aixpert/log/[Link] Contains a trace log of applied security settings. This does not use
syslog. [Link] writes directly to the file. Has -rw------- permissions,
and requires root security.
Related Information
AIX Security Expert in Security.
aixterm Command
Purpose
Initializes an Enhanced X-Windows terminal emulator.
Description
The aixterm command provides a standard terminal type for programs that do not interact directly with
Enhanced X-Windows. This command provides an emulation for a VT102 terminal or a high function
terminal (HFT). The VT102 mode is activated by the -v flag.
The aixterm terminal supports escape sequences that perform terminal functions such as cursor control,
moving and deleting lines, and aixterm private functions.
Many of the special aixterm terminal features (like the scroll bar) can be modified under program control
through a set of private aixterm command escape sequences. You can also use escape sequences to
change the title in the title bar.
The terminal window is the area provided for terminal emulation. When you create a window, a pseudo
terminal is allocated and a command (usually a shell) is started.
The aixterm command automatically highlights the window border and the text cursor when the mouse
cursor enters the window (selected) and unhighlights them when the mouse cursor leaves the window
(unselected). If the window is the focus window, the window is highlighted regardless of the location of the
mouse cursor. Any window manager, as in the case of the AIXwindows Window Manager (MWM), can
cover the aixterm border, and the highlight and border color do not show.
The WINDOWID environment variable is set to the resource ID number of the aixterm window.
When running in an aixterm window, the TERM environment variable should be TERM=aixterm.
The TERM environment variable on your home machine determines what the TERM environment variable
should be on the remote machine (unless it is overridden by your .profile).
If commands (for example, the vi command) do not recognize the term type aixterm when you login to
another system, perform the following one-time operation on the remote system:
1. su
2. cd/tmp
3. mkdir Xxxxx
4. cd Xxxxx
5. ftp LocalSystemName
6. cd /usr/share/lib/terminfo
7. get [Link]
8. quit
9. TERMINFO=/tmp/Xxxxx
10. export TERMINFO
11. tic [Link]
12. ls
13. ls a
14. mkdir /usr/share/lib/terminfo/a
15. cp a/aixterm* /usr/share/lib/terminfo/a
16. cd /tmp
17. rm -r /tmp/Xxxxx
18. exit
19. On the remote machine, enter the following:
a. TERM=aixterm
b. export TERM
Arabic/Hebrew Support
The aixterm command supports bidirectional languages such as Arabic and Hebrew. This command can
open a window to be used with Arabic/Hebrew applications. You can create an Arabic/Hebrew window by
specifying an Arabic or Hebrew locale (ar_AA, Ar_AA, iw_IL, or Iw_IL) with the -lang flag or by
predefining an Arabic or Hebrew locale from SMIT for the system. You can also use the Web-based
System Manager wsm system fast path and selecting the Cultural Environment icon.
The Arabic/Hebrew window supports bidirectional text display. Thus, English and Arabic or Hebrew text
can be displayed on the same line. There are different aspects in the Arabic/Hebrew window:
v Screen Orientation
v Text mode
v Character shaping
v Numeric representation
v Status line
Screen Orientation: The screen orientation in an Arabic/Hebrew window can be either left-to-right or
right-to-left. The default orientation is left-to-right unless otherwise specified with a flag or in the .Xdefaults
file. While the window is active, you can reverse the screen orientation using special key combinations.
You can reverse the screen orientation according to your needs.
In the implicit text mode, characters are stored in same order that they are entered. The text is
transformed into its visual form only when it is displayed. In the visual text mode, characters are stored in
the same way that they are displayed on the window.
Character Shaping: The Arabic/Hebrew window represents Arabic and Hebrew texts differently,
according to its context. Text is represented in one of the following forms:
v Automatic
v Isolated
v Initial
v Middle
v Final
Arabic/Hebrew can also be shaped according to the passthru mode. For more information on character
shaping, see ″Character Shaping″ in AIX 5L Version 5.3 National Language Support Guide and Reference.
Status Line: The Arabic/Hebrew window can display an optional status line that shows the current status
of the window. The status line contains the following values:
Note: Use the implicit text mode (the default text mode) for more efficient data sorting.
Use the following key combinations in an Arabic/Hebrew window to change certain settings.
For more information on the Autopush function, the Push/End Push function, or other Arabic/Hebrew
functions, see the telnet,tn or tn3270 command.
Some escape sequences activate and deactivate an alternate screen buffer that is the same size as the
display area of the window. This capability allows the contents of the screen to be saved and restored.
When the alternate screen is activated, the current screen is saved and replaced with the alternate screen.
Saving lines scrolled off of the window is disabled until the original screen is restored.
The following table uses these abbreviations in the right hand column:
Xv Supported by the aixterm command running in VT100 mode.
Xh Supported by the aixterm command running in HFT mode.
H Found in the HFT data stream.
V Found in the VT100 data stream.
Name
BEL
Function (single-byte control)
Bell
Data Stream
0x07
Support
Xv, Xh, H, V
BS
Function (single-byte control)
Backspace
Data Stream
0x08
Support
Xv, Xh, H, V
HT
Function (single-byte control)
Horizontal tab
Data Stream
0x09
Support
Xv, Xh, H, V
dmi
Function (single-byte control)
disable manual input
Data Stream
ESC ` (back quote)
Support
H
emi
Function (single-byte control)
enable manual input
Data Stream
ESC b
Support
H
ed
Function (single-byte control)
erase display
Data Stream
ESC [ Ps J
Support
v 0 erase to end of display—Xv, Xh, H, V
v 1 erase from display start—Xv, Xh, H, V
v 2 erase all of display—Xv, Xh, H, V
ef
Function (single-byte control)
erase field-e,s,all
Data Stream
ESC [ Ps N
Support
v 0 erase to end of field—Xv, Xh, H
v 1 erase from field start—Xv, Xh, H
v 2 erase all of field—Xv, Xh, H
el
Function (single-byte control)
erase line
Data Stream
ESC [ Ps K
Support
v 0 erase to end of line—Xv, Xh, H, V
v 1 erase from line start—Xv, Xh, H, V
v 2 erase all of line—Xv, Xh, H, V
ech
Function (single-byte control)
erase character
Data Stream
ESC [ Pn X
Support
Xv, Xh, H
sapv
Function
select alternate presentation variant
v 0 set default values for BIDI
v 1 set Arabic numeric shapes
v 2 set Hindi numeric shapes
v 3 set symmetric swapping mode for directional characters
v 5 the following graphic character is presented in its isolated form (Arabic only)
v 6 the following graphic character is presented in its initial form (Arabic only)
v 7 the following graphic character is presented in its middle form (Arabic only)
v 8 the following graphic character is presented in its final form (Arabic only)
v 13 set Special shaping mode
v 14 set standard shaping mode
v 15 reset symmetric mode
v 18 Passthru (everything)
v 19 Passthru (everything except numbers)
v 20 Contextual numbers (device dependent)
v 21 lock 5, 6, 7, 8
v 22 unlock
v 23 set the nonull mode
v 24 reset the nonull mode
v Values 5-8 affect only the following character unless used with values 21 or 22
Data Stream
ESC [Psl;...Psn]
Support
Xh
scp
Function (single-byte control)
save cursor position
Data Stream
ESC [ s
Support
Xv, Xh, H
sg0a
Function (single-byte control)
set GO character set
Data Stream
ESC ( <
Support
Xh, H
sg1a
Function (single-byte control)
set G1 character set
Data Stream
ESC ) <
Support
Xh, H
tbc
Function (single-byte control)
tabulation clear
Data Stream
ESC [ Ps g (default Ps =0)
Support
v 0 clear horizontal tab stop at active position—Xv, Xh, H, V
v 1 vertical tab at line indicated by cursor—H
v 2 horizontal tabs on line—H
v 3 all horizontal tabs—Xv, Xh, H, V
v 4 all vertical tabs—H
Copy The left button is used to save text into the cut buffer. The aixterm command does a text cut, not
a box cut. Move the cursor to beginning of the text, hold the button down while moving the cursor
to the end of the region, and release the button. The selected text is highlighted and saved in the
global cut buffer and made the PRIMARY selection when the button is released.
v Double clicking selects by words.
v Triple clicking selects by lines.
v Quadruple clicking goes back to characters, and so on.
Multiple clicking is determined from the time the button is released to the time the button is
pressed again, so you can change the selection unit in the middle of a selection.
The right button extends the current selection. If you press this button while moving closer to the
right edge of the selection than the left, it extends or contracts the right edge of the selection. If
you contract the selection past the left edge of the selection, the aixterm command assumes you
really meant the left edge, restores the original selection, and extends or contracts the left edge
of the selection. Extension starts in the selection unit mode that the last selection or extension
was performed in; you can multiple click to cycle through them.
By cutting and pasting pieces of text without trailing new lines, you can take text from several places in
different windows and form a command to the shell. For example, you can take output from a program and
insert it into your favorite editor. Since the cut buffer is globally shared among different applications, you
should regard it as a file whose contents you know. The terminal emulator and other text programs should
treat it as if it were a text file, that is, the text is delimited by new lines.
Menu Usage
The aixterm command has two different menus:
v Options
v Modes
Each menu pops up under the correct combinations of key and button presses. Most menus are divided
into two sections that are separated by a horizontal line. The top portion contains various modes that can
be altered. A check mark is displayed next to a mode that is currently active. Selecting one of these
modes toggles its state. The bottom portion of the menu provides the command entries; selecting one of
these performs the indicated function.
The Options menu pops up when the Ctrl key and the left mouse button are pressed simultaneously while
the mouse cursor is in a window. The menu contains items that apply to all emulation modes.
The Modes menu sets various modes for each emulation mode. The menu is activated by pressing the
Ctrl key and the middle mouse button at the same time, while the mouse cursor is in the window. In the
command section of this menu, the soft reset entry resets the scroll regions. This is convenient when a
program leaves the scroll regions set incorrectly. The full reset entry clears the screen, resets tabs to
every eight columns, and resets the terminal modes (such as wrap and smooth scroll) to their initial states
after the aixterm command finishes processing the command-line options. When the Auto Linefeed option
is turned on, a carriage return is added when a carriage return, vertical tab, or form feed is received. The
shells generally do this for the linefeed, but not for the vertical tab or form feed.
Scroll Bar
The aixterm command supports an optional scroll bar composed of a scroll button that displays at the top
of the scroll bar and a scroll region that displays at the bottom. The scroll bar is hidden until you request it
to display.
The scroll region displays the position and amount of text currently showing in the window (highlighted)
relative to the amount of text actually saved in the scrolling buffer. As more text is saved in the scrolling
buffer (up to the maximum), the size of the highlighted area decreases.
The scroll button causes the window to scroll up and down within the saved text. Clicking the right button
moves the window position up (the text scrolls downward); clicking the left button moves the window
position down (the text scrolls upward). The amount of scrolling is modified by the Shift and Ctrl keys. If
neither key is pressed, the window scrolls a single line at a time. Pressing the Shift key causes the text to
scroll a full window at a time, minus one line. Pressing the Ctrl key causes the text to be positioned at the
extreme top or bottom of the file.
The charClass resource is a list of CharRange:Value pairs where the range is either a single number or a
low-to-high number in the range of 0 to 127, corresponding to the ASCII code for the character or
characters to be set. The value is arbitrary, although the default table uses the character number of the
first character occurring in the set.
Key Translations
It is possible to rebind keys (or sequences of keys) to arbitrary strings for input. Changing the translations
for events other than key and button events is not expected, and causes unpredictable behavior.
insert() Processes the key in the normal way (that is, inserts
the ASCII character code corresponding to the keysym
found in the keyboard mapping table into the input
stream).
string(String) Rebinds the key or key sequence to the string value;
that is, inserts the string argument into the input
stream. Quotation marks are necessary if the string
contains white space or non-alphanumeric characters.
If the string argument begins with the characters ``0x,’’
it is interpreted as a hex character constant and the
corresponding character is sent in the normal way.
keymap(Name) Takes a single string argument naming a resource to
be used to dynamically define a new translation table;
the name of the resource is obtained by appending
the string Keymap to Name. The keymap name None
restores the original translation table (the very first
one; a stack is not maintained). Uppercase and
lowercase is significant.
insert-selection(Name[,Name]...)
Retrieves the value of the first (leftmost) named
selection that exists and inserts the value into the
input stream. The Name parameter is the name of any
selection, for example, PRIMARY or SECONDARY.
Uppercase and lowercase is significant.
For example, a debugging session might benefit from the following bindings:
*[Link]: #override <Key>F13: keymap(dbx)
*[Link]:\
<Key>F14: keymap(None) \n\
<Key>F17: string("next") string(0x0d) \n\
<Key>F18: string("step") string(0x0d) \n\
<Key>F19: string("continue") string(0x0d) \n\
<Key>F20: string("print") insert-selection(PRIMARY)
mode-menu() Posts one of the two mode menus, depending on which button is
pressed.
select-start() Deselects any previously selected text and begins selecting new
text.
select-extend() Continues selecting text from the previous starting position.
start-extend() Begins extending the selection from the farthest (left or right)
edge.
select-end(Name[,Name]...)
The aixterm command continues to use the keyboard layout that the X server was using when the aixterm
started. It ignores KeymapNotify by default.
The aixterm command uses the Input Method to convert the X server’s keysyms into either printable
characters or nonprintable escape strings such as function keys. The Input Method uses its own keymap
files, in /usr/lib/nls/loc, to convert X keysyms into code points for the printable characters, and escape
strings for nonprintable characters. There is a keymap file for each language and one keymap file for
scr-rev() Reverses the screen orientation and sets the keyboard layer to the default language of the new
orientation.
You can change these values in the .Xdefaults file. For example, if you want to use Ctrl+Shift to change
language layer, you can add the following line in the .Xdefaults file:
Translations: Ctrl<Key>Shift_R: rtl-lang() \n\
Ctrl<Key>Shift_L: ltr-lang()
Flags
A flag takes on the opposite value if the - (minus sign) is changed to a + (plus sign). The following options
override those set in the .Xdefaults file:
This flag can be turned on and off from the Options menu.
- autopush Enables the Autopush function for the visual text type.
This flag can be turned on and off from the Modes menu.
-display Name:Number Identifies the host name and X Server display number where the aixterm
command is to run. By default, aixterm gets the host name and display
number from the DISPLAY environment variable.
-dw Causes the mouse cursor to move (warp) automatically to the center of
the aixterm window when the aixterm icon window is deiconified. The
default is off.
-e Command Specifies a command to be executed in the window. This flag runs the
command; it does not start a shell. If this flag is used, the command and
its arguments (if any) must be displayed last on the aixterm command
line.
Note: This flag does not work unless the window manager has
started.
-ib File Specifies name of the bitmap file to read for use as the icon bitmap file
instead of the default bitmap file. You can access a /usr/include/X11/
bitmaps file from an operating system shell to see a sample bitmap file.
-im InputMethod Specifies a modifier string that identifies the input method to be used by
the aixterm command.
-j Causes the aixterm command to move multiple lines up at once (jump
scroll) if many lines are queued for display. The default is false.
This flag can be turned on and off from the Modes menu.
This flag can be turned on and off from the Options menu.
This flag must be used in conjunction with the -l flag to work effectively.
-ls Causes the shell run under the aixterm command to be a login shell. The
user’s .login or .profile file is read, and the initial directory is usually the
home directory. The default is false.
-mb Turns on the right margin bell. The default is false.
This flag can be turned on and off from the Modes menu.
-mc Number Determines the multiple-click time. This is used by the cut and paste
button functions.
-mn Ignores the XMappingNotify event. The -mn flag is the default.
-ms Color Determines the color of the mouse cursor on color displays. The default is
the foreground color.
-n IconName Specifies the icon name for use by the aixterm command.
-name Application Specifies the application name to use for the .Xdefaults file.
-nb Number Specifies the right margin distance at which the margin bell rings. The
default is 10 spaces from the right edge of the window.
-nobidi Disables the Arabic/Hebrew functions such as screen reverse, while
maintaining an Arabic/Hebrew locale.
- nonulls Enables a Nonulls mode in which nulls within a line are replaced by
spaces.
-nss NumShape Specifies the default shape of numerals. The NumShape variable can be
one of the following options:
bilingual
Displays numerals according to the surrounding text. For
example, Arabic numerals are displayed within Arabic text and
English numerals within English text.
hindi Displays numerals in Hindi.
arabic Displays numerals in Arabic.
passthru
Displays numerals the same way they are entered.
- orient Orientation Specifies the default screen orientation. The orientation can be one of the
following options:
LTR Left-to-right screen orientation
RTL Right-to-left screen orientation
This flag can be turned on and off from the Modes menu.
-rw Turns on the reverse-wraparound mode. The default is false.
This mode allows the cursor to wraparound from the leftmost column to
the rightmost column of the previous line. This can be useful in the shell
to allow erasing characters backwards across the previous line.
This flag can be turned on and off from the Modes menu.
-s Turns off synchronous scrolling on the display. The default is true.
This flag is intended for use with the scroll bar to review previous lines of
text.
Pressing a key also creates output, which is affected by the -si flag.
This flag can be turned on and off from the Scrollbar menu.
-sl NumberLines Specifies the maximum number of lines to save that scroll off of the top of
the window. The default is 64.
-sn Displays the status line to be displayed in normal video (the status line is
still enclosed in a box). By default, the status line is displayed in
reverse-video relative to the rest of the window. This flag can be turned
on and off from the Modes menu.
-st Displays the status line on startup. The default is false.
-suppress Specifies that the preediting function in the input method IMIoctl call is
suppressed.
- symmetric Enables the Symmetric Swapping mode for handling bidirectional
character pairs such as <> and ().
-T Title Sets the title bar name, but not the icon name. If the -n option is not
specified, or the icon name is not a specified keyword in the .Xdefaults
file, the title is used as the icon name.
This flag can be turned on and off from the Modes menu.
.Xdefaults Keywords
Use the following keywords to set the defaults for the aixterm command.
alwaysHighlight If true, always highlights the cursor, even when the mouse pointer is outside
the window.
autoRaise If true, raises the aixterm window automatically (after a delay of
autoRaiseDelay) when the mouse cursor enters the window. The default is
false. Window managers can override this option.
autoRaiseDelay If autoRaise is true, specifies the number of seconds to delay before
automatically raising a window. The default is 2 seconds. Window managers
can override this option.
background Specifies the color of the window background on color displays. The default is
a white background.
boldFontSet Specifies the name of a bold font. This font must have the same height and
width as the normal sized font.
borderColor Specifies the color of the window border. Window managers can override this
option.
borderWidth Specifies the width of the window border in pixels. The default is 2 pixels.
After a page of lines displays, aixterm stops displaying new lines and the text
cursor disappears. Pressing the Enter key displays one new line. Pressing the
Spacebar key or a character key displays a new page.
preeditType Specifies the pre-edit type for text composing. The possible pre-edit types
are:
over Places the pre-edit window over the spot of character composition.
off Places the pre-edit window off the spot of character composition in the status
area.
root Composes character outside of the current window tree.
none Specifies that the input method has no pre-edit area.
Example
The following example can be used to create an aixterm, specifying the size and location of the window,
using a font other than the default, and also specifying the foreground color that is used in text. The
aixterm command then runs a command in that window.
aixterm -geometry 20x10+0+175 -fn Bld14.500 -fg DarkTurquoise -e
/tmp/banner_cmd &
The aixterm command is NOT an X Toolkit based application. Because of this, the aixterm command gets
resource files as follows:
v System defaults from the first of these it finds:
$XFILESEARCHPATH %T=app-defaults %N=Xdefaults %L=$LANG
$XFILESEARCHPATH %T=app-defaults %N=Xdefaults %L=
/usr/lpp/X11/defaults/$LANG/Xdefaults
/usr/lpp/X11/defaults/Xdefaults
/usr/lib/X11/$LANG/app-defaults/Xdefaults
/usr/lib/X11/app-defaults/Xdefaults
/usr/lpp/X11/defaults/app-defaults/Xdefaults
v Application system defaults from the first of these it finds:
$XFILESEARCHPATH %T=app-defaults %N=Aixterm %L=$LANG
$XFILESEARCHPATH %T=app-defaults %N=Aixterm %L=
$XFILESEARCHPATH %T=app-defaults %N=aixterm %L=$LANG
$XFILESEARCHPATH %T=app-defaults %N=aixterm %L=
/usr/lpp/X11/defaults/$LANG/Aixterm
/usr/lpp/X11/defaults/Aixterm
/usr/lib/X11/$LANG/app-defaults/Aixterm
/usr/lib/X11/app-defaults/Aixterm
/usr/lib/X11/defaults/app-defaults/Aixterm
/usr/lpp/X11/defaults/$LANG/aixterm
Related Information
telnet, tn, or tn3270 command.
Bidirectionality and Character Shaping in AIX 5L Version 5.3 National Language Support Guide and
Reference.
ali Command
Purpose
Lists mail aliases and their addresses.
Syntax
ali [ -alias File ] [ -list | -nolist ] [ -normalize | -nonormalize ] [ -user User | -nouser ] [ Alias ... ]
Description
The ali command lists mail aliases and their addresses. By default, this command searches the
/etc/mh/MailAliases file and writes to standard output each alias and its address defined in the file. To
specify an alternate mail aliases file, use the -alias File flag.
If you specify the -user flag, the ali command searches the alias files for the user name and writes to
standard output the aliases that contain this user name.
Flags
-alias File Specifies the mail alias file to be searched. The default is the /etc/mh/MailAliases file.
Note: For MH, the name of this flag must be fully spelled out.
-list Displays each address on a separate line.
-nolist Displays addresses on as few lines as possible. This flag is the default.
-nonormalize Prevents conversion of local host nicknames to official host names. This is the default.
-normalize Converts local host nicknames to their official host names.
-nouser Lists the address for an alias. This flag is the default.
-user User Lists the aliases that contain the specified user. When the -user and -nonormalize flags are
used together, the result may be a partial list of aliases that contain the specified user.
Examples
1. To display a list of all aliases and their addresses in the /etc/mh/MailAliases file, enter:
ali
2. To list the names and addresses of the mygroup alias, enter:
ali mygroup
Files
$HOME/.mh_profile Contains the MH user profile.
/etc/group Contains a list of groups.
/etc/passwd Contains a list of users.
/etc/mh/MailAliases Contains the default mail alias file.
/usr/bin/ali Contains the ali command.
Related Information
The comp command, dist command, forw command, repl command, send command, whom command.
alias Command
Purpose
Defines or displays aliases.
Syntax
alias [ -t ] [ -x ] [ AliasName [ =String ] ] ...
Description
The alias command creates or redefines alias definitions or writes existing alias definitions to standard
output.
If no flags or parameters are supplied, all existing alias definitions are written to standard output. You can
display a specific alias definition by using the AliasName parameter.
Create a new alias by using the AliasName=String parameter pair. When the shell encounters an alias on
the command line or in a shell script, it substitutes the definition supplied by the string. The String variable
If you specify the -t flag, the shell displays aliases that are tracked. A tracked command uses the full path
name of the command. A tracked command can become undefined when the value of the PATH
environment variable is reset, but aliases created with the -t flag remain tracked.
If you specify the -x flag, the shell displays aliases that are exported. An exported alias is active in all
shells.
An alias definition affects the current shell environment and the execution environments of any subshells.
The alias definition affects neither the parent process of the current shell nor any utility environment
invoked by the shell.
Flags
-t Sets or displays all existing tracked aliases. If this flag is used with the AliasName parameter, the new alias is
tracked and the alias definition includes the full path name obtained by doing a path search. When the value of
the PATH environment variable is reset, the alias definition becomes undefined but remains tracked.
-x Displays all existing exported alias definitions. If this flag is used with the AliasName parameter, the new alias
is exported. Exported alias are not defined across separate invocations of the shell. You must put alias
definitions in your environment file to have aliases defined for separate shell invocations.
Exit Status
The following exit values are returned:
0 Successful completion.
>0 One of the specified alias name did not have an alias definition, or an error occurred.
Examples
1. To change the ls command so that it displays information in columns and annotates the output, enter:
alias ls=’ls -CF’
2. To create a command for repeating previous entries in the command history file, enter:
alias r=’fc -s’
3. To use 1KB units for the du command, enter:
alias du=du\ -k
4. To create a command to display all active processes for user Dee, enter:
alias psc=’ps -ef | grep Dee’
5. To see the full path name of the ls command, enter:
alias -t ls
Files
/usr/bin/ksh Contains the Korn shell alias built-in command.
/usr/bin/alias Contains the alias command.
alog Command
Purpose
Creates and maintains fixed-size log files created from standard input.
Syntax
To Show the Contents of a Log File
alog -f LogFile [ -o ]
Description
The alog command reads standard input, writes to standard output, and copies the output into a fixed-size
file. This file is treated as a circular log. If the file is full, new entries are written over the oldest existing
entries.
The alog command works with log files that are specified on the command line or with logs that are
defined in the alog configuration database. Logs that are defined in the alog configuration database are
identified by LogType. The File, Size, and Verbosity attributes for each defined LogType are stored in the
alog configuration database with the LogType. You can add a new LogType to the alog configuration
database using the odmadd command. You can change the attributes of LogType defined in the alog
configuration database using the alog command.
Flags
-C Changes the attributes for a specified LogType. Use the -C flag with the -f, -s, and -w flags to
change the File, Size, and Verbosity attributes for the specified LogType. The -t LogType
flag is required.
Note: Using the -C flag with -sSize only changes the size value in ODM and does not
change the size of the actual log file.
If the -C flag is used, the alog command does not copy standard input to standard output or
to a log file.
When the -C flag is used to modify the attributes for the console log type, the console log file
is also modified and the console device driver is updated to use the new values. This is a
deviation from the normal operation of alog -C and is done to accommodate special
formatting in the console log file.
Note: You must have root user authority to change alog attributes.
If the -L flag is used, the alog command does not copy standard input to standard output or
to File.
-o Lists the contents of the log file. Writes the contents of the log file to standard output in
sequential order.
-q Copies standard input to a log file but does not write to standard output.
-s Size Specifies the size limit of the log file in bytes. The space for the log file is reserved when it is
created. If you create a new log file and do not specify the Size attribute, the minimum size,
4096 bytes, is used. If the log file already exists, its size will be changed. The size you
specify is rounded upward to the next integral multiple of 4096 bytes. The maximum size for
a log file is 2 GB. If the specified size is greater than 2 GB, only 2 GB is considered. If you
decrease the size of the log file, the oldest entries in the log are deleted if they do not fit
within the new size limit. You must have write permission for the log file to change its size.
Use the -s Size flag with the -C and the -t flags to change the Size attribute for LogType
defined in the alog configuration database. Only the size value in ODM is changed. The size
of the actual log file remains the same. The new Size attribute value is used the next time a
log file is created.
-t LogType Identifies a log defined in the alog configuration database. The alog command gets the log’s
file name and size from the alog configuration database. If LogFile does not exist, one is
created.
If the alog command cannot get the information for the specified LogType from the alog
configuration database or if the alog command is unable to write to LogFile, it writes to
/dev/null.
If you specify LogType and LogFile using the -f flag, LogFile is used and LogType is ignored.
-V Writes the current value of the Verbosity attribute for LogType that is defined in the alog
configuration database to standard output. If you do not specify LogType, or the LogType you
specify is not defined, nothing is written to standard output.
The value output using the alog command with the -t LogType and the -V flags can be used
by a command that is piping its output to the alog command to control the verbosity of the
data it writes to the pipe.
-w Verbosity Changes the Verbosity attribute for LogType defined in the alog configuration database when
used with the -C and the -t flags.
The Verbosity attribute can have a value from 0 to 9. If the value is 0, no information is
copied to LogFile by the alog command. All of the information is still written to standard
output. If the value is not 0, all of the information piped to the alog command’s standard input
is copied to LogFile and to standard output.
Examples
1. To record the current date and time in a log file named [Link], enter:
date | alog -f /tmp/[Link]
2. To list the contents of /tmp/[Link] log file, enter:
alog -f /tmp/[Link] -o
3. To change the size of the log file named /tmp/[Link] to 8192 bytes, enter:
echo "resizing log file" | alog -f /tmp/[Link] -s 8192
Files
/etc/objrepos/SWservAt Software Service Aids Attributes Object Class
Related Information
The odmadd command.
How to Add Objects to an Object Class in AIX 5L Version 5.3 General Programming Concepts: Writing and
Debugging Programs.
alstat Command
Purpose
Shows alignment exception statistics.
Syntax
alstat [ -e | -v ] [ Interval ] [ Count ]
Description
The alstat command displays alignment exception statistics. Alignment exceptions may occur when the
processor cannot perform a memory access due to an unsupported memory alignment offset (such as a
floating point double load from an address that is not a multiple of 8). However, some types of unaligned
memory references may be corrected by some processors and does not generate an alignment exception.
The default output displays statistics every second. The sampling Interval and Count of iterations can be
also specified.
Parameters
Interval Interval between samples.
Count Number of iterations.
Flags
-e Displays emulation exception statistics. This flag cannot
be used with the -v flag.
-v Display individual processor statistics. This flag cannot be
used with the -e flag.
Examples
1. To display alignment exception statistics every second, type:
alstat
This produces the following output:
Alignment Alignment
SinceBoot Delta
8845591 0
8845591 0
8845591 0
8845591 0
8845591 0
8845591 0
...
2. To display emulation and alignment exception statistics every two seconds, a total of 5 times, type:
alstat -e 2 5
This produces the following output:
Emulation Emulation Alignment Alignment
SinceBoot Delta SinceBoot Delta
21260604 0 70091846 0
23423104 2162500 72193861 2102015
25609796 2186692 74292759 2098898
27772897 2163101 76392234 2099475
29958509 2185612 78490284 2098050
3. To display alignment exception statistics, every 5 seconds, for each processor, type:
alstat -v 5
This produces the following output:
Alignment Alignment Alignment Alignment
SinceBoot Delta Delta00 Delta01
88406295 0 0 0
93697825 5291530 0 5291530
98930330 5232505 5232505 0
102595591 3665261 232697 3432564
102595591 0 0 0
alt_disk_copy Command
Purpose
Clones (makes a copy of) the currently running system to an alternate disk.
Syntax
To copy rootvg to Alternate Disk:
alt_disk_copy -d target_disks... [-i [Link]] [-s script [-b bundle_name] [-I installp_flags] [-l
images_location] [-f fix_bundle] [-F fixes] [-e exclude_list] [-w filesets] [-n] [-P phase_option] [-c console] [
-x first boot script ] [-R resolve_conf] [-DBOVgr]
Description
The alt_disk_copy command allows users to copy the current rootvg to an alternate disk and to update
the operating system to the next maintenance or technology level, without taking the machine down for an
extended period of time and mitigating outage risk. This can be done by creating a copy of the current
rootvg on an alternate disk and simultaneously applying software updates. If needed, the bootlist
command can be run after the new disk has been booted, and the bootlist can be changed to boot back to
the older maintenance or technology level of the operating system.
Cloning the running rootvg, allows the user to create a backup copy of the root volume group. This copy
can be used as a back up in case the rootvg failed, or it can be modified by installing additional updates.
One scenario might be to clone a 5300-00 system, and then install updates to bring the cloned rootvg to
5300-01. This would update the system while it was still running. Rebooting from the new rootvg would
bring the level of the running system to 5300-01. If there was a problem with this level, changing the
bootlist back to the 5300-00 disk and rebooting would bring the system back to 5300-00. Other scenarios
would include cloning the rootvg and applying individual fixes, rebooting the system and testing those
fixes, and rebooting back to the original rootvg if there was a problem.
At the end of the install, a volume group, altinst_rootvg, is left on the target disks in the varied off state
as a place holder. If varied on, it indicates that it owns no logical volumes; however, the volume group
does contain logical volumes, but they have been removed from the ODM because their names now
conflict with the names of the logical volumes on the running system. Do not vary on the altinst_rootvg
volume group; instead, leave the definition there as a placeholder.
After rebooting from the new alternate disk, the former rootvg volume group shows up in a lspv listing as
old_rootvg, and it includes all disks in the original rootvg. This former rootvg volume group is set to not
vary-on at reboot, and it should only be removed with the alt_rootvg_op -X old_rootvg or
alt_disk_install -X old_rootvg commands.
If a return to the original rootvg is necessary, the bootlist command is used to change the bootlist to
reboot from the original rootvg.
Notes:
1. Alternate disk operations create volume groups, logical volumes, special device files, and file systems
using the alt prefix. If alt_disk_copy is utilized on a system, the administrator should avoid having or
creating volume groups, logical volumes, special device files, or file systems with the alt,
prefix—alternate disk operations might inadvertently remove, alter, or damage these items.
2. NIM alternate disk migration (upgrading version or release levels) is supported with the nimadm
command in AIX 5.1 and later. Please see the nimadm documentation for more details.
Flags
-b bundle_name Path name of optional file with a list of packages or filesets that are installed after a
rootvg clone. The -l flag must be used with this option.
-c Console The device name to be used as the alternate rootvg’s system console. This option is
only valid with the -O flag.
-e exclude_list Optional [Link] to use when cloning rootvg. The rules for exclusion follow the
pattern-matching rules of the grep command. The exclude_list must be a full path
name.
Note: If you want to exclude certain files from the backup, create the
/etc/[Link] file with an ASCII editor and enter the patterns of file names that
you do not want included in your system backup image. The patterns in this file are
input to the pattern-matching conventions of the grep command to determine which
files will be excluded from the backup. If you want to exclude files listed in the
/etc/[Link] file, select the Exclude Files field and press the Tab key once
to change the default value to yes. For example, to exclude all the contents of the
scratch directory, edit the exclude file to read as follows:
/scratch/
For example, to exclude the contents of the /tmp directory, and avoid excluding any
other directories that have /tmp in the path name, edit the exclude file to read as
follows:
^./tmp/
All files are backed up relative to . (current working directory). To exclude any file or
directory for which it is important to have the search match the string at the beginning
of the line, use the caret character (^) as the first character in the search string,
followed by the dot character (.), followed by the filename or directory to be excluded.
If the filename or directory being excluded is a substring of another filename or
directory, use the caret character followed by the dot character (^.) to indicate that the
search should start at the beginning of the line, and use the dollar sign character ($)
to indicate that the search should end at the end of the line.
-f fix_bundle Optional file with a list of APARs to install after a clone of rootvg. The -l flag must be
used with this option.
-F fixes Optional list of APARs (for example, IX123456) to install after a clone of rootvg. The
-l flag must be used with this option.
-I installp_flags The flags to use when updating or installing new filesets into the cloned
alt_inst_rootvg. The default flag is -acgX. The -l flag must be used with this option.
-l images_location Location of installp images or updates to apply after a clone of rootvg. This can be
a directory full path name or device name (such as /dev/rmt0).
-w filesets List of filesets to install after cloning a rootvg. The -l flag must be used with this
option.
Exit Status
0 All alt_disk_copy related operations completed successfully.
>0 An error occurred.
Examples
1. To clone the running 5300-00 rootvg to hdisk3, then apply updates from /updates to bring the cloned
rootvg to a 5300-01 level:
alt_disk_copy -d hdisk3 -F 5300-01_AIX_ML -l /updates
The bootlist would then be set to boot from hdisk3 at the next reboot.
2. To clone the running rootvg to hdisk3 and hdisk4, and execute update_all on all updates from
/updates:
alt_disk_copy -d "hdisk3 hdisk4" -b update_all -l /updates
The bootlist would then be set to boot from hdisk3 at the next reboot.
3. To clone the running rootvg to hdisk1 and stop after phase 1:
alt_disk_copy -d hdisk1 -P1
Location
/usr/sbin/alt_disk_copy
Files
/usr/sbin/alt_disk_copy Contains the alt_disk_copy command.
Related Information
“alt_disk_mksysb Command” on page 104, “alt_rootvg_op Command” on page 107, “bootlist Command”
on page 231, “bosboot Command” on page 239,
The nim, nimadm command in AIX 5L Version 5.3 Commands Reference, Volume 4.
alt_disk_install Command
Purpose
Installs an alternate disk with a mksysb install image or clones the currently running system to an
alternate disk. This command is obsolete in AIX 5.3.
Note: In AIX 5.3, the alt_disk_install command is replaced by the alt_disk_copy, alt_disk_mksysb, and
alt_rootvg_op commands. The alt_disk_install module continues to be shipped as a wrapper to
the new commands, but the alt_disk_install command does not support any new functions, flags,
or features.
Syntax
″ Create Alternate Disk: ″
alt_disk_install { -d device | -C} [ -i [Link]] [ -s script ] [ -R resolv_conf] [ -D] [ -B] [ -V]
[ -r] [ -O ]
[ -p platform ] [ -L mksysb_level ]
[ -b bundle_name ] [ -I installp_flags ]
[ -l images_location ] [ -f fix_bundle ]
[ -F fixes ] [ -e exclude_list ] [ -w filesets ]
[ -n] [ -P phase_option ] target_disks...
″Clean Up Alternate Disk Volume Group:″
alt_disk_install -X
Description
Note: In AIX 5.3 the alt_disk_install command has been broken up into three commands:
alt_disk_copy, alt_disk_mksysb, and alt_rootvg_op. No new functionality will be added to this
command.
The alt_disk_install command allows users a way to update the operating system to the next release,
maintenance level, or technology level, without taking the machine down for an extended period of time.
This can be done in two ways, by installing a mksysb image on a separate disk, or by cloning the current
system and then applying updates to get to the next maintenance or technology level.
Attention: alt_disk_install creates volume groups, logical volumes, special device files, and file systems
using the ″alt″ prefix. If alt_disk_install is utilized on a system, the administrator should avoid having or
creating volume groups, logical volumes, special device files, or file systems with the ″alt″ prefix -
alt_disk_install operations may inadvertently remove, alter, or damage these items.
The first function, installing a mksysb, requires an AIX 4.3 or later mksysb image, an AIX 4.3 or later
mksysb tape, or an AIX 4.3.3 or later mksysb CD. The alt_disk_install command is called with a disk or
disks that are not currently in use, and the mksysb is restored to those disks such that, if the user
chooses, the next reboot boots the system on an AIX 4.3 or later system.
Notes:
1. You cannot use alt_disk_install to install an earlier version of AIX than the one currently installed on
the system. For example, you cannot install an AIX 4.3 mksysb on an AIX 5.1 system.
2. If needed, the bootlist command can be run after the new disk has been booted, and the bootlist can
be changed to boot back to the older version of the operating system.
The second function, cloning the running rootvg, allows the user to create a backup copy of the root
volume group. This copy could be used as a back up in case the rootvg failed, or it could be modified by
installing additional updates. One scenario might be to clone a 4.2.0 system, then install updates to bring
the cloned rootvg to [Link]. This would update the system while it was still running, then rebooting from
the new rootvg would bring the level of the running system to 4.2.1. If there was a problem with this level,
changing the bootlist back to the 4.2.0 disk and rebooting would bring the system back to 4.2.0. Other
scenarios would include cloning the rootvg and applying individual fixes, rebooting the system and testing
those fixes, and rebooting back to the original rootvg if there was a problem.
Note: NIM alternate disk migration (upgrading version or release levels) is supported with the nimadm
command in AIX 5.1 and later. Please see the nimadm documentation for more details.
Currently, you can run the alt_disk_install command on [Link] and higher systems for both of these
functions. The bos.alt_disk_install.rte fileset must be installed on the system to execute the
alt_disk_install command, and the bos.alt_disk_install.boot_images fileset must also be installed to
perform a mksysb install to an alternate disk.
The mksysb image that is used must be created ahead of time and have all the necessary device and
kernel support required for the system that it’s going to be installed on. No new device or kernel support
can be installed before the system is rebooted from the newly installed disk.
When cloning the rootvg volume group, a new boot image is created with the bosboot command. When
installing a mksysb image, a boot image for the level of mksysb and platform type is copied to the boot
logical volume for the new alternate rootvg. When the system is rebooted, the bosboot command is run in
the early stage of boot, and the system is rebooted once again. This is to synchronize the boot image with
the mksysb that was just restored. The system then boots in normal mode.
At the end of the install, a volume group, altinst_rootvg, is left on the target disks in the varied off state as
a place holder. If varied on, it shows as owning no logical volumes, but it does indeed contain logical
volumes, but they have been removed from the ODM because their names now conflict with the names of
the logical volumes on the running system. It is recommended that you not vary on the altinst_rootvg
volume group, but just leave the definition there as a place holder.
After the system reboots from the new alternate disk, the former rootvg volume group does not show up in
a lspv listing, unless the alt_disk_install version is 4.3.2 or higher.
After rebooting from the new alternate disk, the former rootvg volume group shows up in a lspv
listing as ″old_rootvg″, and includes all disk(s) in the original rootvg. This former rootvg volume group
is set to NOT varyon at reboot, and should ONLY be removed with the -X flag (i.e. alt_disk_install
-X old_rootvg).
If a return to the original rootvg is necessary, the bootlist command is used to change the bootlist to reboot
from the original rootvg.
If it is unclear which disk is the boot disk for a specific volume group, the -q flag can be used to
determine the boot disk. This can be useful when a volume group is comprised of multiple disks and
a change in the bootlist is necessary.
The alternate root file system is mounted as /alt_inst, so other file systems would have that prefix
(/alt_inst/usr, /alt_inst/var). This is how they should be accessed if using a customization script.
Attention: If you have created an alternate rootvg with alt_disk_install, but no longer wish to use it,
or want to run alt_disk_install commands, do not run exportvg on altinst_rootvg.
Simply run the alt_disk_install -X command to remove the altinst_rootvg definition from the ODM
database. The reason you cannot run the exportvg command (or the reducevg command) is that
the logical volume names and file systems now have the real names, and exportvg removes the
stanza’s for the real file system from /etc/filesystems for the real rootvg.
If exportvg is run by accident, be sure to recreate the /etc/filesystems file before rebooting the
system. The system will not reboot without a correct /etc/filesystems file.
This function is also available with the Network Installation Management (NIM). See the NIM Guide for
more information.
The AIX 4.3.1 and greater version of alt_disk_install can be executed in phases. The install is divided
into three phases, and the default is to perform all three phases.
Phase 1 Creates the altinst_rootvg volume group, the alt_ ″logical volumes″, the /alt_inst file systems, and
restores the mksysb or rootvg data.
You can run each phase separately, run Phases 1 and 2 together, or run Phases 2 and 3 together. Phase
2 can be run multiple times before Phase 3 is run.
You must run Phase 3 to get a volume group that is a usable rootvg. Running Phase 1 and 2 leave the
/alt_inst file systems mounted.
If you have run Phase 1 and or Phase 2, and want to start over (remove the altinst_rootvg), run the
alt_disk_install-x command to clean up.
If data access is necessary between the original rootvg and the new alternate disk, a volume group
″wake-up″ can be accomplished, using the -W flag, on the non-booted volume group. The ″wake-up″
puts the volume group in a post alt_disk_install phase 1 state (i.e. the /alt_inst file systems will be
mounted).
Note: The volume group that experiences the ″wake-up″ will be renamed ″altinst_rootvg″.
Limitation
The running system’s version of operating system must be greater than or equal to the operating
system version of the volume group that undergoes the ″wake-up″. This may mean that it’s
necessary to boot from the ″altinst_rootvg″ and ″wake-up″ the ″old_rootvg″.
For example: An alternate disk is created from an alt_disk_install 4.3.3 mksysb, on a 4.1.5
running system. To access data between the two volume groups, it is necessary to boot from
the 4.3.3 alternate disk and ″wake-up″ the 4.1.5 ″old_rootvg″ volume group.
This limitation is caused by a jfs log entry incompatibility. It is possible to ″wake-up″ a volume group
that contains a greater operating system version, but the volume group could not have ever been the
system rootvg. If so, the volume group would have made jfs log entries that could not be interpreted
by an older operating system version rootvg, when the volume group was experiencing a ″wake-up″.
JFS log entries are usually present for file systems that were not unmounted before a reboot, for
example, /,/usr.
The alt_disk_install command will not allow a ″wake-up″ to occur on a volume group with a greater
operating system version, unless the FORCE environment variable is set to ″yes″.
Attention: If a FORCE ″wake-up″ is attempted on a volume group that contains a greater operating
system version then the running operating system, AND the ″waking″ volume group has been a
system rootvg, errors will occur.
When data access is no longer needed, the volume group can be put to sleep, using the -S flag.
Note: The volume group that has experienced a ″wake-up″ MUST be ″put-to-sleep″ before it can be
booted and used as the rootvg.
OR
path name of mksysb image in a file system.
If certain logical volumes need to be placed on a specific target disk, this should
be annotated in the logical volume LV_SOURCE_DISK_LIST field of the user
specified [Link] file.
-p platform This is a platform to use to create the name of the disk boot image, which may be
supplied by a vendor that wanted to support this function. This flag is only valid for
mksysb installs (-d flag).
-Pphase The phase to execute during this invocation of alt_disk_install. Valid values are: 1, 2,
3, 12, 23, or all.
v 12 - performs phases 1 and 2.
v 23 - performs phases 2 and 3.
v all - performs all three phases
-r Would specify to reboot from the new disk when the alt_disk_install command is
complete.
-R resolv_conf The [Link] file to replace the existing one after the mksysb has been restored or
the rootvg has been cloned. You must use a full pathname for resolv_conf.
-s script Optional customization script to run at the end of the mksysb install or the rootvg clone.
This file must be executable. This script is called on the running system before the
/alt_inst file systems are unmounted, so files can be copied from the running system to
the /alt_inst file systems before the reboot. This is the only opportunity to copy or
modify files in the alternate file system because the logical volume names will be
changed to match rootvg’s, and they will not be accessible until the system is rebooted
with the new alternate rootvg, or a ″wake-up″ is performed on the altinst_rootvg. You
must use a full pathname for script.
-V Turn on verbose output. This shows the files that are being backed up for rootvg
clones. This flag shows files that are restored for mksysb alt_disk_installs.
-L mksysb_level This level will be combined with the platform type to create the boot image name to use
(for example, rspc_4.3.0_boot in AIX 5.1 and earlier). This must be in the form V.R.M.
The default will be AIX 4.3. The mksysb image will be checked against this level to
verify that they are the same.
-n Remain NIM client. The /.rhosts and /etc/niminfo files are copied to the alternate
rootvg’s file system.
For alt_disk_install 4.3.2 or greater, the flag allows for specified volume group
name ODM database definition removal, for example, -X old_rootvg.
Notes:
1. The -B and -X flags are mutually exclusive.
2. If you specify the -X flag, all other flags are ignored.
-O Performs a device reset on the target altinst_rootvg. This will cause alt_disk_install to
NOT retain any user defined device configurations. This flag is useful if the target disk
or disks will become the rootvg of a different system (such as in the case of logical
partitioning or system disk swap).
The following flags are only valid for use when cloning the rootvg (-C).
-b bundle_name Pathname of optional file with a list of packages or filesets that will be installed
after a rootvg clone. The -l flag must be used with this option.
-e exclude_list Optional [Link] to use when cloning rootvg. The rules for exclusion follow
the pattern matching rules of the grep command. The exclude_list must be a full
pathname.
Note: If you want to exclude certain files from the backup, create the
/etc/[Link] file, with an ASCII editor, and enter the patterns of file
names that you do not want included in your system backup image. The
patterns in this file are input to the pattern matching conventions of the
grep command to determine which files will be excluded from the backup. If
you want to exclude files listed in the /etc/[Link] file, select the
Exclude Files field and press the Tab key once to change the default value
to yes.
For example, to exclude all the contents of the directory called scratch, edit
the exclude file to read as follows:
/scratch/
For example, to exclude the contents of the directory called /tmp, and avoid
excluding any other directories that have /tmp in the pathname, edit the
exclude file to read as follows:
^./tmp/
The following flags are available for alt_disk_install version 4.3.2 or greater:
-q disk Used to return the volume group boot disk name. This is
especially useful when trying to determine the boot disk
from several disks in the ″old_rootvg″ volume group, after
rebooting from the alternate disk.
-S Will ″put-to-sleep″ the volume group. This is used after a
volume group ″wake-up″. (-W).
-v new_volume_group_name disk Used to rename the alternate disk volume group. This is
especially useful when creating multiple alternate disks, on
multiple volume groups, and name identification is
necessary.
-W disk Used to ″wake-up″ a volume group for data access between
the rootvg and the alternate disk rootvg.
Limitation
The running system’s version of the operating system must be greater than or equal to the operating
system version of the volume group that undergoes the ″wake-up″. This may mean that it’s
necessary to boot from the ″altinst_rootvg″ and ″wake-up″ the ″old_rootvg″.
Parameters
target_disks Specifies the name or names of the target disks where the alternate rootvg will be created.
This disk or these disks must not currently contain any volume group definition. The lspv
command should show these disks as belonging to volume group None.
Examples
1. To clone the running 4.2.0 rootvg to hdisk3, then apply updates from /updates to bring the cloned
rootvg to a 4.2.1 level:
alt_disk_install -C -F 4.2.1.0_AIX_ML -l /updates hdisk3
The bootlist would then be set to boot from hdisk3 at the next reboot.
2. To install a 4.3 mksysb image on hdisk3, then run a customized script (/home/myscript) to copy some
user files over to the alternate rootvg file systems before reboot:
alt_disk_install -d /mksysb_images/4.3_mksysb -s /home/myscript hdisk3
3. To remove the original rootvg ODM database entry, after booting from the new alternate disk:
alt_disk_install -X old_rootvg
The lspv listing for the original rootvg will be changed to ″None″. Therefore, a new volume group could
be created on those disks.
4. To determine the boot disk for a volume group with multiple physical volume:
alt_disk_install -q hdisk0
Illustrated Example
Files
/usr/sbin/alt_disk_install Contains the alt_disk_install command
alt_disk_mksysb Command
Purpose
Installs an alternate disk with a mksysb install base install image.
Syntax
alt_disk_mksysb -m device -d target_disks... [ -i [Link] ] [ -s script ] [-R resolv_conf ] [ -p platform ] [
-L mksysb_level ] [ -n ] [ -P phase_option ] [ -c console ] [ -K ] [ -DBOVgkrxyz ]
Description
The alt_disk_mksysb command allows the users to install a mksysb system backup to a separate disk
without taking the machine down for an extended period of time and mitigating outage risk.
Installing a mksysb requires an AIX 4.3 or later mksysb image, mksysb tape, or mksysb CD. The
alt_disk_mksysb command is called with a disk or set of disks that is not currently in use, and the
mksysb is restored to those disks such that, if the user chooses, the next reboot boots the system on an
AIX 4.3 or later system.
The mksysb image that is used must be created ahead of time and have all the necessary device and
kernel support required for the system it will be installed on. No new device or kernel support can be
installed before the system is rebooted from the newly installed disk.
The alternate root file system is mounted as /alt_inst, so other file systems would have that prefix (for
example, /alt_inst/usr, /alt_inst/var). This is how they should be accessed using a customization script.
At the end of the install, a volume group, altinst_rootvg, is left on the target disks in the varied off state
as a place holder. If varied on, it indicates that it owns no logical volumes; however, it does contain logical
volumes, but they have been removed from the ODM because their names now conflict with the names of
the logical volumes on the running system. Do not vary on the altinst_rootvg volume group; instead,
leave the altinst_rootvg volume group as a placeholder.
After the system reboots from the new alternate disk, the former rootvg volume group will show up in the
lspv listing as old_rootvg. Do not vary on the old_rootvg volume group; instead, leave the old_rootvg
volume group as a placeholder.
If a return to the original rootvg is necessary, the bootlist command is used to change the bootlist to
reboot from the original rootvg.
Notes:
1. Alternate disk operations create volume groups, logical volumes, special device files, and file systems
using the alt prefix. If alt_disk_copy is utilized on a system, the administrator should avoid having or
creating volume groups, logical volumes, special device files, or file systems with the alt,
prefix—alternate disk operations might inadvertently remove, alter, or damage these items.
2. alt_disk_mksysb needs to use preexisting boot images during mksysb installation. alt_disk_mksysb
first looks for the boot images in the alternate rootvg (that is, the contents of the mksysb); if boot
images are not found, alt_disk_mksysb searches for them in the current rootvg.
Flags
-B Specifies not running bootlist after the operation. If set, then the -r flag cannot be used.
-c console Specifies the device name to be used as the alternate rootvg's system console. This option is
only valid with the -O flag.
-D Turns on debug (sets -x output).
-d target_disks Specifies a space-delimited list of the name or names of the target disks where the alternate
rootvg is created. This disk or these disks must not currently contain any volume group
definition. The lspv command should indicate that these disks belong to volume group None.
-g Specifies that bootable checks for the target_disks are overlooked.
-K Specifies that the 64-bit kernel should be used, if possible.
-k Specifies that mksysb devices be kept (formally the ALT_KEEP_MDEV variable).
-i image_data Optional [Link] file to use instead of the default [Link] file from mksysb image.
The [Link] file name must be a full path name (for example, /tmp/my_image.data).
-L mksysb_level This level is combined with the platform type to create the boot image name to use (for
example, rspc_5.1.0_boot in AIX 5.1 and earlier). This must be in the form V.R.M. The
mksysb image is checked against this level to verify that they are the same.
-m device The value for device can be:
v Tape device (for example, /dev/rmt0)
v Path name of mksysb image in a file system
-n Remain NIM client. The /.rhosts and /etc/niminfo files are copied to the alternate rootvg’s
file system.
Exit Status
0 All alt_disk_mksysb related operations completed successfully.
>0 An error occurred.
Examples
1. To install a mksysb image on hdisk3 and hdisk4 , then run a customized script (/tmp/script) to copy
some user files over to the alternate rootvg file systems before reboot:
alt_disk_mksysb -m /mksysb_images/my_mksysb -d "hdisk3 hdisk4" -s /tmp/script
2. To install a mksysb image on hdisk2 and stop after phase 1:
alt_disk_mksysb -m /mksysb_images/my_mksysb -d hdisk2 -P1
3. To execute phases 2 and 3 on an existing alternate rootvg on hdisk4 and reboot the system upon
successful completion:
alt_disk_mksysb -d hdisk4 -m /mksysb_images/my_mksysb -P23 -r
Location
/usr/sbin/alt_disk_mksysb
Files
/usr/sbin/alt_disk_mksysb Contains the alt_disk_mksysb command.
The nim, nimadm command in AIX 5L Version 5.3 Commands Reference, Volume 4.
alt_rootvg_op Command
Purpose
Performs operations on existing alternate rootvg volume groups.
Syntax
To determine Volume Group Boot Disk (-q):
alt_rootvg_op -S [-tD]
alt_rootvg_op -C [-R resolv_conf] [-s script] [-b bundle_name] [-I installp_flags] [-l images_location] [-f
fix_bundle] [-F fixes] [-w filesets] [-DV]
Description
The alt_rootvg_op command can be used to determine which disk is the boot disk for a specific volume
group. Use the -q flag to determine the boot disk. This can be useful when a volume group is comprised
of multiple disks and a change in the bootlist is necessary.
This command can also be used to rename the alternate disk volume groups. This is especially useful
when creating multiple alternate disks, on multiple volume groups, and name identification is necessary.
If data access is necessary between the current rootvg and an alternate disk, use the alt_rootvg_op
command to perform a volume group ″wake-up″ (using the -W flag) on the nonbooted volume group. The
″wake-up″ puts the volume group in a post phase 1 state (that is, the /alt_inst file systems will be
mounted). The customize operation (-C flag) can be executed at this time.
The alt_rootvg_op command does not allow a ″wake-up″ to occur on a volume group with a greater
operating system version, unless the FORCE environment variable is set to Yes.
Notes:
1. The volume group that experiences the ″wake-up″ is renamed altinst_rootvg.
2. Do not execute phase 3 on the volume group that experiences the ″wake-up.″
3. Do not reboot the system if there is a volume group in the ″wake″ state. This can cause damage or
data loss to the volume group that is in the ″wake″ state. Volume groups in the ″wake″ state can be
put to ″sleep″ with the -S flag.
When data access is no longer needed, the alt_rootvg_op command can be used to put to sleep the
volume group in the ″wake″ state, using the -S flag. The boot image on the target alternate rootvg can be
rebuilt if necessary with the -t flag. The sleep operations revert the alternate volume group to an inactive
state.
When cleaning up the alternate disk volume group, the alt_rootvg_op command uses the -X flag to
remove the altinst_rootvg volume group definition from the ODM database. If the target volume group is
varied off at the time this operation is executed, only the ODM definitions associated with the target
volume group are removed. The actual volume group data is not removed. If the volume group is bootable,
you can still reboot from that volume group, by setting the bootlist to a boot disk in this volume group. The
-X flag accepts a volume group name as an argument and acts on the altinst_rootvg volume group by
default.
The customize operation of the alt_rootvg_op command (using the -C flag) can be used to perform the
following functions on an active alternate root volume group:
v Install software and software updates. Apply this operation only to alternate volume groups created with
the rootvg copy operation.
v Execute customization script.
v Copy [Link] files.
Flags
-b bundle_name Path name of optional file with a list of packages or filesets that will be installed after a
rootvg clone. The -l flag must be used with this option.
-C Performs the customization operation on the active rootvg volume group.
-d target_disk Specifies a space-delimited list of the name or names of the target disks that will be targets
of the given operation.
-D Turns on debug (sets -x output).
-f fix_bundle Optional file with a list of APARs to install after a clone of rootvg. The -l flag must be used
with this option.
-F fixes Optional list of APARs (for example, IY123456) to install after a clone of rootvg. The -l flag
must be used with this option.
-I installp_flags The flags to use when updating or installing new filesets into the cloned alt_inst_rootvg. The
default flag is -acgX. The -l flag must be used with this option.
-l images_location Location of installp images or updates to apply after a clone of rootvg. This can be a
directory full path name or device name (like /dev/rmt0).
-q Determines the volume group boot disk.
-R resolv_conf The [Link] file to replace the existing one in the rootvg. You must specify a full path
name.
Exit Status
0 All alt_rootvg_op related operations completed successfully.
>0 An error occurred.
Examples
1. To remove the original rootvg ODM database entry, after booting from the new alternate disk, enter
the following command:
alt_rootvg_op -X old_rootvg
2. To cleanup the current alternate disk install operation, enter the following command:
alt_rootvg_op -X
3. To determine the boot disk for a volume group with multiple physical volume, enter the following
command:
alt_rootvg_op -q -d hdisk0
Illustrated Example
# lspv
# alt_rootvg_op -q -d hdisk0
hdisk2
4. To modify an alt_disk_install volume group name, enter the following command:
alt_rootvg_op -v alt_disk_530 -d hdisk2
Illustrated Example
# lspv
#lspv
Location
/usr/sbin/alt_rootvg_op
Files
/usr/sbin/alt_rootvg_op Contains the alt_rootvg_op command.
Related Information
“alt_disk_copy Command” on page 93, “alt_disk_mksysb Command” on page 104, “bootlist Command” on
page 231, “bosboot Command” on page 239.
The nim, nimadm command in AIX 5L Version 5.3 Commands Reference, Volume 4.
anno Command
Purpose
Annotates messages.
Syntax
anno [ +Folder ] [ Messages ] [ -component Field ] [ -inplace | -noinplace ] [ -text ″String″ ]
Description
The anno command annotates messages with text and dates. If you enter the anno command without any
flags, the system responds with the following prompt:
Enter component name:
Typing a component name and pressing the Enter key annotates the component name and system date to
the top of the message being processed. You cannot annotate an existing field. You can only add lines to
the top of a message file. The annotation fields can contain only alphanumeric characters and dashes.
Note: To simply add distribution information to a message, use the dist, forw, or repl commands.
Note: For MH (Message Handler), the name of this flag must be fully spelled
out.
-inplace Forces annotation to be done in place in order to preserve links to the annotated
messages.
Messages Specifies what messages to annotate. This parameter can specify several messages,
a range of messages, or a single message. If several messages are specified, the
first message annotated becomes the current message. Use the following references
to specify messages:
Number
Number of the message. When specifying several messages, separate each
number with a comma. When specifying a range, separate the first and last
number in the range with a hyphen.
Sequence
A group of messages specified by the user. Recognized values include:
all All messages in the folder.
cur or . (period)
Current message. This is the default.
first First message in a folder.
last Last message in a folder.
next
Message following the current message.
prev Message preceding the current message.
Profile Entries
The following entries can be made to the UserMhDirectory/.mh_profile file:
Examples
1. To annotate the message being processed with the date and time, enter:
anno
Press Enter. The component name you entered becomes the prefix to the date and time on the
message. The caption appended to the message is similar to the following:
Date: Tues, 28 Mar 89 [Link] -0600
2. To annotate the message being processed with the date, time, and a message, enter:
Note: Do not press the Enter key until the entire message has been entered, even though the
message may be wider than the screen.
Files
$HOME/.mh_profile Contains the MH user profile.
/usr/bin/anno Contains anno command.
Related Information
The dist command, forw command, repl command.
ap Command
Purpose
Parses and reformats addresses.
Syntax
ap [ -form File | -format String ] [ -normalize | -nonormalize ] [ -width Number ] Address
Description
The ap command parses and reformats addresses. The ap command is not started by the user. The ap
command is called by other programs. The command is typically called by its full path name,
/usr/lib/mh/ap.
The ap command parses each string specified by the address parameter and attempts to reformat it. The
default output format for the ap command is the ARPA RFC 822 standard. When the default format is
used, the ap command displays an error message for each string it is unable to parse.
Flags
-form File Reformats the address string specified by the Address parameter into the alternate format
described in the File variable.
-format String Reformats the address string specified by the Address parameter into the alternate format
specified by the String variable. The default format string follows:
%<{error}%{error}:%{Address}%:%(putstr(proper{
Address}))%>
-help Lists the command syntax, available switches (toggles), and version information.
Note: For MH, the name of this flag must be fully spelled out.
-nonormalize Does not attempt to convert local nicknames of hosts to their official host names.
-normalize Attempts to convert local nicknames of hosts to their official host names. This flag is the
default.
-width Number Sets the maximum number of columns the ap command uses to display dates and error
messages. The default is the width of the display.
Files
/etc/mh/mtstailor Contains the MH tailor file.
$HOME/.mh_profile Contains the MH user profile.
Related Information
The ali command, dp command, scan command.
apply Command
Purpose
Applies a command to a set of parameters.
Syntax
apply [ -aCharacter ] [ -Number ] CommandString Parameter ...
Description
The apply command runs a command string specified by the CommandString parameter on each
specified value of the Parameter parameter in turn. Normally, Parameter values are chosen individually;
the optional -Number flag specifies the number of Parameter values to be passed to the specified
command string. If the value of the Number variable is 0, the command string is run without parameters
once for each Parameter value.
If you include character sequences of the form %n (where n is a digit from 1 to 9) in CommandString, they
are replaced by the nth unused Parameter value following the CommandString parameter when the
command string is executed. If any such sequences occur, the apply command ignores the -Number flag,
and the number of parameters passed to CommandString is the maximum value of n in the
CommandString parameter.
Notes:
1. Because pattern-matching characters in CommandString may have undesirable effects, it is
recommended that complicated commands be enclosed in ’ ’ (single quotation marks).
2. You cannot pass a literal % (percent sign) followed immediately by any number without using the
-a flag.
Flags
-aCharacter Specifies a character (other than %) to designate parameter substitution strings.
-Number Specifies the number of parameters to be passed to CommandString each time it is run.
Examples
1. To obtain results similar to those of the ls command, enter:
apply echo *
2. To compare the file named a1 to the file named b1, and the file named a2 to the file named b2, enter:
apply -2 cmp a1 b1 a2 b2
3. To run the who command five times, enter:
apply -0 who 1 2 3 4 5
4. To link all files in the current directory to the directory /usr/joe, enter:
apply ’ln %1 /usr/joe’ *
Related Information
The xargs command.
Input and output redirection overview in Operating system and device management.
apropos Command
Purpose
Locates commands by keyword lookup.
Syntax
apropos [ -M PathName ] Keyword ...
Description
The apropos command shows the manual sections that contain any of the keywords specified by the
Keyword parameter in their title. The apropos command considers each word separately and does not
take into account if a letter is in uppercase or lowercase. Words that are part of other words are also
displayed. For example, when looking for the word compile, the apropos command also finds all instances
of the word compiler. The database containing the keywords is /usr/share/man/whatis, which must first
be generated with the catman -w command.
The apropos command is equivalent to using the man command with the -k option.
Note: When the /usr/share/man/whatis database is built from the HTML library using the catman -w
command, section 3 is equivalent to section 2 or 3. See the man command for further explanation of
sections.
Flag
-M PathName Specifies an alternative search path. The search path is specified by the PathName parameter,
and is a colon-separated list of directories.
Examples
1. To find the manual sections that contain the word password in their titles, enter:
apropos password
2. To find the manual sections that contain the word editor in their titles, enter:
apropos editor
File
/usr/share/man/whatis Contains the whatis database.
Related Information
The catman command, man command, whatis command.
ar Command
Purpose
Maintains the indexed libraries used by the linkage editor.
Syntax
ar [ -c ] [ -l ] [ -g | -o ] [ -s ] [ -v ] [ -C ] [ -T ] [ -z ] { -h | -p | -t | -x } [ -X
{32|64|32_64|d64| any}] ArchiveFile [ File ... ]
ar [ -c ] [ -l ] [ -g | -o ] [ -s ] [ -v ] [ -C ] [ -T ] [ -z ] { -m | -r [ -u ] } [ { -a | -b | -i }
PositionName ] [ -X {32|64|32_64|d64|any}] ArchiveFile File ...
ar [ -c ] [ -l ] [ -g | -o ] [ -s ] [ -v ] [ -C ] [ -T ] [ -z ] { -d | -q } [ -X
{32|64|32_64|d64|any}] ArchiveFile File ...
ar [ -c ] [ -l ] [ -v ] [ -C ] [ -T ] [ -z ] { -g | -o | -s | -w } [ -X {32|64|32_64|d64|any}]
ArchiveFile
Description
The ar command maintains the indexed libraries used by the linkage editor. The ar command combines
one or more named files into a single archive file written in ar archive format. When the ar command
There are two file formats that the ar command recognizes. The Big Archive Format, ar_big, is the default
file format and supports both 32-bit and 64-bit object files. The Small Archive Format can be used to
create archives that are recognized on versions older than AIX 4.3, see the -g flag. If a 64-bit object is
added to a small format archive, ar first converts it to the big format, unless -g is specified. By default, ar
only handles 32-bit object files; any 64-bit object files in an archive are silently ignored. To change this
behavior, use the -X flag or set the OBJECT_MODE environment variable.
Flags
In an ar command, you can specify any number of optional flags from the set cClosTv. You must specify
one flag from the set of flags dhmopqrstwx. If you select the -m or -r flag, you may also specify a
positioning flag (-a, -b, or -i); for the -a, -b, or -i flags, you must also specify the name of a file within
ArchiveFile (PositionName), immediately following the flag list and separated from it by a blank.
-a PositionName Positions the named files after the existing file identified by the PositionName
parameter.
-b PositionName Positions the named files before the existing file identified by the PositionName
parameter.
-c Suppresses the normal message that is produced when library is created.
-C Prevents extracted files from replacing like-named files in the file system.
-d Deletes the named files from the library.
-g Orders the members of the archive to ensure maximum loader efficiency with a
minimum amount of unused space. In almost all cases, the -g flag physically positions
the archive members in the order in which they are logically linked. The resulting
archive is always written in the small format, so this flag can be used to convert a
big-format archive to a small-format archive. Archives that contain 64-bit XCOFF objects
cannot be created in or converted to the small format.
-h Sets the modification times in the member headers of the named files to the current
date and time. If you do not specify any file names, the ar command sets the time
stamps of all member headers. This flag cannot be used with the -z flag.
-i PositionName Positions the named files before the existing file identified by the PositionName
parameter (same as the -b).
-l Places temporary files in the current (local) directory instead of the TMPDIR directory
(by default /tmp).
-m Moves the named files to some other position in the library. By default, it moves the
named files to the end of the library. Use a positioning flag (abi) to specify some other
position.
-o Orders the members of the archive to ensure maximum loader efficiency with a
minimum amount of unused space. In almost all cases, the -o flag physically positions
the archive members in the order in which they are logically linked. The resulting
archive is always written in the big archive format, so this flag can be used to convert a
small-format archive to a big-format archive.
-p Writes to standard output the contents of the named in the Files parameter, or all files
specified in the ArchiveFile parameter if you do not specify any files.
-q Adds the named files to the end of the library. In addition, if you name the same file
twice, it may be put in the library twice.
-r Replaces a named file if it already appears in the library. Because the named files
occupy the same position in the library as the files they replace, a positioning flag does
not have any additional effect. When used with the -u flag (update), the -r flag replaces
only files modified since they were last added to the library file.
If a named file does not already appear in the library, the ar command adds it. In this
case, positioning flags do affect placement. If you do not specify a position, new files
are placed at the end of the library. If you name the same file twice, it may be put in the
library twice.
The default is to process 32-bit object files (ignore 64-bit objects). The mode can also
be set with the OBJECT_MODE environment variable. For example,
OBJECT_MODE=64 causes ar to process any 64-bit objects and ignore 32-bit objects.
The -X flag overrides the OBJECT_MODE variable.
-z Creates a temporary copy of the archive and performs all requested modifications to
the copy. When all operations have completed successfully, the working copy of the
archive is copied over the original copy. This flag cannot be used with the -h flag.
ArchiveFile Specifies an archive file name; required.
MemberName ... Names of individual archive members.
Exit Status
This command returns the following exit values:
0 Successful completion.
>0 An error occurred.
Examples
1. To create a library, enter:
ar -v -q lib.a strlen.o strcpy.o
If the lib.a library does not exist, this command creates it and enters into it copies of the files
strlen.o and strcpy.o. If the lib.a library does exist, then this command adds the new members to
This command lists the table of contents of the lib.a library, displaying a long listing similar to the
output of the ls -l command. To list only the member file names, omit the -v flag.
3. To replace or add new members to a library, enter:
ar -v -r lib.a strlen.o strcat.o
This command replaces the members strlen.o and strcat.o. If lib.a was created as shown in
example 1, then the strlen.o member is replaced. A member named strcat.o does not already
exist, so it is added to the end of the library.
4. To specify where to insert a new member, enter:
ar -v -r -b strlen.o lib.a strcmp.o
This command adds the strcmp.o file, placing the new member before the strlen.o member.
5. To update a member if it has been changed, enter:
ar -v -r -u lib.a strcpy.o
This command replaces the existing strcpy.o member, but only if the file strcpy.o has been modified
since it was last added to the library.
6. To change the order of the library members, enter:
ar -v -m -a strcmp.o lib.a strcat.o strcpy.o
This command moves the members strcat.o and strcpy.o to positions immediately after the
strcmp.o member. The relative order of the strcat.o and strcpy.o members is preserved. In other
words, if the strcpy.o member preceded the strcat.o member before the move, it still does.
7. To extract library members, enter:
ar -v -x lib.a strcat.o strcpy.o
This command copies the members strcat.o and strcpy.o into individual files named strcat.o and
strcpy.o, respectively.
8. To extract and rename a member, enter:
ar -p lib.a strcpy.o >stringcopy.o
This command deletes the member strlen.o from the lib.a library.
10. To create an archive library from multiple shared modules created with the ld command, enter:
ar -r -v libshr.a shrsub.o shrsub2.o shrsub3.o ...
This command creates an archive library named libshr.a from the shared modules named shrsub.o,
shrsub2.o, shrsub3.o, and so on. To compile and link the main program using the libshr.a archive
library, use the following command:
cc -o main main.c -L/u/sharedlib -lshr
The main program is now executable. Any symbols referenced by the main program that are
contained by the libshr.a archive library have been marked for deferred resolution. The -l flag
specifies that the libshr.a library be searched for the symbols.
File
/tmp/ar* Contains temporary files.
Related Information
The ld command, lorder command, make command, nm command, strip command.
arithmetic Command
Purpose
Tests arithmetic skills.
Syntax
arithmetic [ + ] [ - ] [ x ] [ / ] [ Range ]
Description
The arithmetic command displays simple arithmetic problems and waits for you to enter an answer. If
your answer is correct, the program displays Right! and presents a new problem. If your answer is wrong,
it displays What? and waits for another answer. After a set of 20 problems, the arithmetic command
displays the number of correct and incorrect responses and the time required to answer.
The arithmetic command does not give the correct answers to the problems it displays. It provides
practice rather than instruction in performing arithmetic calculations.
To quit the game, press the Interrupt (Ctrl-C) key sequence; the arithmetic command displays the final
game statistics and exits.
Flags
The optional flags modify the action of the arithmetic command. These flags are:
If you do not select any flags, the arithmetic command selects addition and subtraction problems and a
default range of 10. If you give more than one problem specifier (+, - ,x, /), the program mixes the
specified types of problems in random order.
File
/usr/games Location of the system’s games.
Related Information
The back command, bj command, craps command, fish command, fortune command, hangman
command, moo command, number command, quiz command, ttt command, turnoff command, turnon
command, wump command.
arp Command
Purpose
Displays and modifies address resolution, including ATM (Asynchronous Transfer Mode) interfaces.
Syntax
To Display ARP Entries
arp { [ -t ifType ] HostName | -a [ n ] [ /dev/kmem ] }
Description
The arp command displays and modifies the Internet-to-adapter address translation tables used by the
Address in Networks and communication management. The arp command displays the current ARP entry
for the host specified by the HostName variable. The host can be specified by name or number, using
Internet dotted decimal notation.
Displays all of the current ARP entries. Specify the -a /dev/kmem flag to display
ARP information for kernel memory. The ’n’ modifier causes hostname lookups to
be suppressed.
The pvc specification will display only ATM PVC (Permanent Virtual Circuits)
types of virtual circuits, svc specification will display only ATM SVC (Switched
Virtual Circuits) types of virtual circuits. If the pvc | svc parameter is omitted, all
ATM virtual circuits will be displayed.
-d Used as [ -t ifType ] -d HostName
Deletes an entry for the host specified by the HostName variable if the user has
root user authority.
Deletes a PVC ARP entry by specifying vpi:vci rather than hostname. The vpi:vci
variables specify the virtual circuit that is to be deleted. The ifname variable
specifies the name of the ATM interface on which the virtual circuit is to be
deleted.
-f FileName [Type] Causes the file specified by the FileName variable to be read and multiple entries
to be set in the ARP tables. Entries in the file should be in the form:
[Type] HostName AdapterAddress [Route] [temp] [pub]
where
Type Specifies the type of hardware address. If the address type is specified
when invoking arp from the command line, it should not be specified in
the file entries. Otherwise, it should be specified in each file entry. Valid
hardware address types are:
v ether for an Ethernet interface
v 802.3 for an 802.3 interface
v fddi for a Fiber Distributed Data interface
v 802.5 for a Token-Ring interface
HostName
Specifies the remote host.
AdapterAddress
Specifies the hardware address of the adapter for this host as 6
hexadecimal bytes separated by colons. Use the netstat -v command to
display the local hardware address.
Route Specifies the route for a Token-Ring interface or Fiber Distributed Data
Interface (FDDI) as defined in the Token-Ring or FDDI header.
temp Specifies that this ARP table entry is temporary. The table entry is
permanent if this argument is omitted.
pub Specifies that this table entry is to be published, and that this system will
act as an ARP server responding to requests for HostName, even though
the host address is not its own.
Creates an ARP entry of the type specified by the Type variable for the host
specified by the HostName variable with the adapter address specified by the
AdapterAddress variable. Only users with root authority can use the -s flag. The
adapter address is given as 6 hexadecimal bytes separated by colons. The line
must be in the following format:
Type HostName AdapterAddress [Route] [temp] [pub]
where the Type, HostName, AdapterAddress, Route, temp, and pub parameters
have the same purpose and definitions as the parameters for the -f flag.
Creates a SVC type of ARP entry for the remote host, specified by the HostName
variable, with the ATM address specified by the ATMAddress variable. The ATM
address is given as 20 hexadecimal bytes separated by colons. Creation of this
entry causes this IP station to not use ARP server mechanism to resolve IP
addresses.
Creates a PVC type of ARP entry for the remote host, specified by the HostName
variable, with the PVC specified by the vpi:vci. Either destination Hostname or the
local ifname needs to be specified. The no-llc flag is used to indicate that
LLC/SNAP encapsulation will not be used on this virtual circuit, in this case, the
destination Hostname needs to be specified. The no-arp flag is used to indicate
that ARP protocol will not be used on this virtual circuit, in this case, the
destination Hostname needs to be specified.
The temp parameter specifies that this ARP table entry is temporary, the table
entry is permanent if this argument is omitted.
-t ifType The -t iftype flag is used to indicate the type of Network interface. It is optional for
the following types of interfaces:
v et for IEEE 802.3 Ethernet (inet)
v tr for Token-Ring (inet)
v xt for X.25 (inet)
v sl for serial line IP (inet)
v lo for loopback (inet)
v op for serial (inet)
Examples
1. To add a single entry to the arp mapping tables until the next time the system is restarted, type:
arp -s 802.3 host2 [Link] temp
2. To delete a map table entry for the specified host with the arp command, type:
arp -d host1 flag
3. To display arp entries for atm host host1 , type:
arp -t atm -a host1
4. To add a PVC arp entry for atm host host2, type:
arp -t atm -s atm pvc 0:20 host2
5. To add a PVC arp entry for an interface at0, type:
Related Information
The ifconfig command, netstat command.
as Command
Purpose
Reads and assembles a source file.
Syntax
as [ -a Mode ] [ -o ObjectFile ] [ -n Name ] [ -u ] [ -l [ ListFile ] ] [ -W | -w ] [ -x [ XCrossFile ] ] [ -s [
ListFile ] ] [ -m ModeName ] [-Eoff|on ] [ -poff|on ] [ -i ] [ -v ] [ File ]
Description
The as command reads and assembles the named File (by convention, this file ends with a .s suffix). If
you do not specify a File, the as command reads and assembles standard input. It stores its output, by
default, in a file named [Link]. The output is stored in the XCOFF file format.
Flags
-a Mode Specifies the mode in which the as command operates. By default, the as command
operates in 32-bit mode, but the mode can be explicitly set by using the flag -a32 for
32-bit mode operation or -a64 for 64-bit mode operation.
-l[ListFile] Produces an assembler listing. If you do not specify a file name, a default name is
produced by replacing the suffix extension of the source file name with a .lst extension.
By convention, the source file suffix is a .s. For example:
[Link]
If the source code is from standard input and the -l flag is used without specifying an
assembler-listing file name, the listing file name is [Link].
If this flag is not used and no .machine pseudo-op is present in the source program, the
default assembly mode is used. The default assembly mode has the POWER
family/PowerPC intersection as the target environment, but treats all POWER
family/PowerPC incompatibility errors (including instructions outside the POWER
family/PowerPC intersection and invalid form errors) as instructional warnings.
If an assembly mode that is not valid is specified and no .machine pseudo-op is present
in the source program, an error is reported and the default assembly mode is used for
instruction validation in pass 1 of the assembler.
If the -m flag is used, the ModeName variable can specify one of the following values:
″″ Explicitly specifies the default assembly mode that has the POWER
family/PowerPC intersection as the target environment, but treats instructions
outside the POWER family/PowerPC intersection and invalid form errors as
instructional warnings. A space is required between -m and the null string
argument (two double quotation marks).
com Specifies the POWER family/PowerPC intersection mode. A source program can
contain only instructions that are common to both POWER family and PowerPC;
any other instruction causes an error. Any instruction with an invalid form causes
errors, terminates the assembly process, and results in no object code being
generated.
Note: Certain POWER family instructions are supported by the PowerPC 601
RISC Microprocessor in AIX 5.1 and earlier, but do not conform to the PowerPC
architecture. These instructions cause errors when using the com assembly
mode.
any Specifies the indiscriminate mode. The assembler generates object code for any
recognized instruction, regardless of architecture. This mode is used primarily for
operating system development and for testing and debugging purposes.
Note: All POWER family and PowerPC incompatibility errors are ignored when
using the any assembly mode, and no warnings are generated.
ppc Specifies the PowerPC mode. A source program can contain only PowerPC
instructions. Any other instruction causes an error.
Notes:
1. The PowerPC optional instructions are implemented in each PowerPC
processor and do not belong to the ppc mode. These instructions generate
an error if they appear in a source program that is assembled using the ppc
assembly mode.
2. Certain instructions conform to the PowerPC architecture, but are not
supported by the PowerPC 601 RISC Microprocessor in AIX 5.1 and earlier.
ppc64 Specifies the POWER-based 64-bit mode. A source program can contain 64-bit
POWER-based instructions.
pwr Specifies the POWER™ mode. A source program can contain only instructions
for the POWER implementation of the POWER architecture.
Attention: It is recommended that the 601 assembly mode not be used for
applications that are intended to be portable to future PowerPC systems. The
com or ppc assembly mode should be used for such applications.
The PowerPC 601 RISC Microprocessor in AIX 5.1 and earlier implements the
POWER-based platform plus some POWER family instructions are not included
in the POWER-based platform. This allows existing POWER applications to run
with acceptable performance on POWER-based systems.
603 Specifies the PowerPC 603 RISC Microprocessor mode through AIX 5.1 only. A
source program can contain only instructions for the PowerPC 603 RISC
Microprocessor in AIX 5.1 and earlier.
604 Specifies the PowerPC 604 RISC Microprocessormode. A source program can
contain only instructions for the PowerPC 604 RISC Microprocessor.
970 Specifies the PowerPC 970 mode. A source program can contain instructions
valid for PowerPC 970 compatible processors.
A35 Specifies the A35 mode. A source program can contain only instructions for the
A35.
pwr5x Specifies the POWER5+ mode. A source program can contain instructions valid
for POWER5+ compatible processors.
pwr6 Specifies the POWER6 mode. A source program can contain instructions valid
for POWER6 compatible processors.
-n Name Specifies the name that appears in the header of the assembler listing. By default, the
header contains the name of the assembler source file.
-o ObjectFile Writes the output of the assembly process to the specified file instead of to the [Link] file.
Because the -s flag is used to change the assembler-listing format, it implies the -l flag. If
both option flags are used and different assembler-listing file names (specified by the
ListFile variable) are given, the listing file name specified by the ListFile variable used
with the -l flag is used. If an assembler-listing file name is not specified with either the -l
or -s flag, a default assembler listing file name is produced by replacing the suffix
extension of the source file name with a .lst extension.
-u Accepts an undefined symbol as an extern so that an error message is not displayed.
Otherwise, undefined symbols are flagged with error messages.
-W Turns off all warning message reporting, including the instructional warning messages
(the POWER family and PowerPC incompatibility warnings).
-w Turns on warning message reporting, including reporting of instructional warning
messages (the POWER family and PowerPC incompatibility warnings).
Note: When neither -W nor -w is specified, the instructional warnings are reported, but
other warnings are suppressed.
-x[XCrossFile] Produces cross reference output. If you do not specify a file name, a default name is
produced by replacing the suffix extension of the source file name with an .xref
extension. Conventionally, the suffix is a .s. For example:
[Link]
Note: The assembler does not generate an object file when the -x flag is used.
-E Specifies whether to report errors due to the new v2.00 syntax (-Eon), or to ignore them
(-Eoff). By default, v2.00 errors are ignored.
-p Specifies whether to use new v2.00 branch prediction (-pon), or pre-v2.00 branch
prediction (-poff). By default, pre-v2.00 branch prediction is used.
-i Specifies that branch prediction suffixes are to be encoded. By default, this option is not
set. This option will be ignored if the -p option is specified.
-v Displays the version number of this command.
File Specifies the source file. If no file is specified, the source code is taken from standard
input.
Environment Variables
OBJECT_MODE
The assembler respects the setting of the OBJECT_MODE environment variable. If neither -a32 or
-a64 is used, the environment is examined for this variable. If the value of the variable is anything
other than the values listed in the following table, an error message is generated and the
assembler exits with a non-zero return code. The implied behavior corresponding to the valid
settings are as follows:
OBJECT_MODE = 32 Produce 32-bit object code. The default machine setting is com.
OBJECT_MODE = 64 Produce 64-bit object code (XCOFF64 files). The default
machine setting is ppc64.
OBJECT_MODE = 32_64 Invalid.
OBJECT_MODE = anything else Invalid.
Files
/usr/ccs/bin/as Contains the as command
[Link] The default output file.
Related Information
The ld command, m4 command.
Purpose
Prints FORTRAN files to in line-printer conventions.
Syntax
{ asa | fpr } [ File ... ]
Description
The asa and fpr commands print FORTRAN files to conform to this operating systems line-printer
conventions. Both commands work like a filter to transform files formatted according to FORTRAN carriage
control conventions into files formatted according to line-printer conventions.
The File variable specifies the name of the input file that the asa and fpr commands read instead of the
standard input. The asa and fpr commands read the file, replace the carriage control characters with
recognizable operating system characters, and print the file to standard output.
Both commands read the first character of each line from the input file, interpret the character, and space
the line according to the definition of the first character. If the first character is either a Blank, a 0, a dash
(-) , a 1, or a plus sign (+), either command does the following:
Blank Advances the carriage one line and prints the input line.
0 Advances the carriage two lines and prints the input line.
- Advances the carriage three lines and prints the input line.
1 Advances the carriage to the top of the next page.
+ Does not advance the carriage and starts printing the input line in the first space of the output file.
Note: Results are undefined for input lines longer than 170 characters.
Exit Status
This command returns the following exit values:
0 Successful completion.
>0 An error occurred.
Examples
1. Use the fpr command in the following manner to change the carriage control characters in an [Link]
file produced by a FORTRAN compiler into carriage control characters and print the resulting file:
[Link] | fpr | qprt
2. Use the asa command in the following manner to run the [Link] file through the asa command to
change carriage control characters from FORTRAN to the operating system and print the resulting file.
asa [Link] | qprt
Files
/usr/ucb/fpr Contains the fpr command.
/usr/bin/asa Contains the asa command.
Related Information
The fsplit command, qprt command, struct command.
at Command
Purpose
Runs commands at a later time.
Syntax
To Schedule Jobs to Run at a Later Time
at [ -c | -k | -s | -q Queue ] [ -m ] [ -f File ] { -t Date |Time [ Day ] [ Increment ] }
at -n [ User ]
at -r [ -F ] [ -i ] -u User
The at command mails you all output from standard output and standard error for the scheduled
commands, unless you redirect that output. It also writes the job number and the scheduled time to
standard error.
When the at command is executed, it retains the current process environment. It does not retain open file
descriptors, traps, and priority.
The /var/adm/cron/[Link] and /var/adm/cron/[Link] files control what users can use the at command.
A person with root user authority can create, edit, or delete these files. Entries in these files are user login
names with one name to a line. The following is an example of an [Link] file:
root
nick
dee
sarah
If the [Link] file exists, only users whose login names appear in it can use the at command. A system
administrator can explicitly stop a user from using the at command by listing the user’s login name in the
[Link] file. If only the [Link] file exists, any user whose name does not appear in the file can use the at
command.
If the [Link] file does not exist and the [Link] file does not exist or is empty, only someone with root
user authority can submit a job with the at command.
To schedule a job to run at a later time, you must specify a time to start the job. You may specify the time
by using either the -t Date flag or the Time, Day, and Increment parameters. At most, 60 jobs can be
scheduled in any given run queue at the granularity of one per second. If more jobs than can be handled
are submitted, for every job beyond 60, a file _at<pid> is created in /var/spool/cron/atjobs/ which can be
safely deleted by the end user.
The Date variable to the -t flag is specified using the following format:
[[CC]YY]MMDDhhmm[.SS]
Both the CC and YY digits are optional. If neither is given, the current year is assumed. If the YY digits are
specified but the CC digits are not, the CC digits are defined as follows:
The Time parameter may be specified as a number followed by an optional suffix. The at command
interprets one- and two-digit numbers as hours. It interprets four digits as hours and minutes. The T_FMT
item in the LC_TIME locale category specifies the order of hours and minutes. The default order is the
hour followed by the minute. You can also separate hours and minutes with a : (colon). The default order
is Hour:Minute.
If you do not specify am or pm, the at command uses a 24-hour clock. These suffixes can follow the time
as a separate argument or separated with spaces. The am and pm suffixes are defined values from the
AM_STR and PM_STR items in the LC_TIME locale category. The suffix zulu indicates that the time is
GMT (Greenwich Mean Time).
The at command also recognizes the following keywords as special values for the Time parameter:
v noon
v midnight
v now
v A for AM
v P for PM
v N for noon
v M for midnight
You may specify the optional Day parameter as either a month name and a day number (and possibly a
year number preceded by a comma), or a day of the week. The D_FMT item in the LC_TIME locale
category specifies the order of the month and day (by default, month followed by day). The DAY_1 through
DAY_7 items in the LC_TIME locale category specify long day names. The ABDAY_1 through ABDAY_7
items in the LC_TIME locale category specify short day names. The MON_1 through MON_12 items in the
LC_TIME locale category specify long month names. The ABMON_1 through ABMON_12 items in the
LC_TIME locale category specify short month names. By default, the long name is fully spelled out; the
short name is abbreviated to two or more characters for weekdays, and three characters for months.
The at command recognizes today and tomorrow as special default values for the Day parameter. The
today value is the default Day if the specified time is later than the current hour; the tomorrow value is
the default if the time is earlier than the current hour. If the specified month is less than the current month
(and a year is not given), next year is the default year.
Flags
-c Requests that the csh command be used for executing this job.
-f File Uses the specified file as input rather than using standard input.
-F Suppresses delete verification. Use this flag with the -r flag.
-i Specifies interactive delete. Use this flag with the -r flag.
-k Requests that the ksh command be used for executing this job.
Parameters
Day Specifies the optional Day parameter as either a month name and a day number (and possibly a
year number preceded by a comma), or a day of the week.
Increment The optional Increment parameter can be one of the following:
Event Information
AT_JobAdd Lists at jobs that were run, the time the task was completed, and the user who issued the
command.
See ″Setting Up Auditing″ in Security for more details about how to properly select and group audit events,
and how to configure audit event data collection.
Exit Status
This command returns the following exit values:
Examples
1. To schedule the command from the terminal, enter a command similar to one of the following:
If uuclean is in your current directory, enter:
at 5 pm Friday
uuclean
<Ctrl-D>
Note: When entering a command name as the last item on the command line, a full path name must
be given if the command is not in the current directory, and the at command will not accept any
arguments.
2. To run the uuclean command at 3:00 in the afternoon on the 24th of January, enter any one of the
following commands:
echo uuclean | at 3:00 pm January 24
at -l
5. To cancel a job, enter:
at -r ctw.635677200.a
Files
/var/adm/cron/FIFO A named pipe that sends messages to the cron daemon when new jobs
are submitted with the crontab or at commands.
/usr/bin/at Contains the at command.
/var/adm/cron Contains the main cron directory.
/var/adm/cron/[Link] Specifies the list of allowed users.
/var/adm/cron/[Link] Specifies the list of denied users.
Related Information
The atq command, atrm command, auditpr command, batch command, bsh command, kill command,
ksh command, mail command, nice command, ps command, sh command, su command.
Auditing Overview in Security provides more information about audits and audit events.
Input and output redirection overview in Operating system and device management describes how the
operating system processes input and output.
National Language Support Overview for Programming in Operating system and device management
explains collating sequences, equivalence classes, and locale.
Shells in Operating system and device management describes what shells are, the different types of
shells, and how shells affect the way commands are interpreted.
ate Command
Purpose
Starts the Asynchronous Terminal Emulation (ATE) program.
Syntax
ate
Description
The ate command starts the Asynchronous Terminal Emulation (ATE) program. The ATE program
establishes a connection between a workstation and a remote computer. A workstation acts as a terminal
connected to the remote computer. Using ATE the user can connect to, and exchange data with, remote
databases and other systems.
Note: Users must be a member of the UNIX-to-UNIX Copy Program (uucp) group in order to use
ATE. A user with root authority uses System Management Interface Tool (SMIT) to install individual
users in groups.
The ATE program uses menus and subcommands. From the menus, users issue subcommands to
connect to a remote system, receive and transfer files, and execute commands. The Unconnected Main
Menu displays any time users issue the ate command. The Connected Main Menu displays when users
press the MAINMENU_KEY (usually the Ctrl-V key sequence) while connected to another system. The
connect subcommand makes the connection.
The ATE program supports three control key sequences: the CAPTURE_KEY (usually Ctrl-B),
PREVIOUS_KEY (usually CTRL-R), and MAINMENU_KEY (usually CTRL-V). These control keys do not
function until the ATE program is started. The control keys and other ATE defaults can be changed by
editing the [Link] file format.
Examples
To start the ATE program, enter:
ate
Subcommands
alter Temporarily changes data transmission characteristics in the ATE program.
break Interrupts current activity on a remote system.
connect Connects to a remote computer.
directory Displays the ATE dialing directory.
help Provides help information for the ATE subcommands.
modify Temporarily modifies local settings used for terminal emulation.
perform Allows the user to issue workstation operating system commands while using ATE.
quit Exits the Asynchronous Terminal Emulation (ATE) program.
receive Receives a file from a remote system.
send Sends a file to a remote system.
terminate Terminates an ATE connection to a remote system.
alter Subcommand
a [ l CharacterLength ] [ s StopBit ] [ p Parity ] [ r BaudRate ] [ d Device ] [ i DialPrefix ] [ f DialSuffix ] [ w
Seconds ] [ a RedialAttempts ] [ t TransferProtocol ] [ c PacingType ]
Note: The default values of the alter subcommand flags can be permanently changed by editing the
[Link] file format.
The alter subcommand is accessed from the Asynchronous Terminal Emulation (ATE) Connected or
Unconnected Main Menu. Issuing the ate command from the command line displays the Unconnected
Main Menu. The alter subcommand temporarily changes these data transmission characteristics:
v Data character length
v Baud rate
v Stop and parity bits
v Port name
v Modem dialing prefixes and suffixes
v Waiting time and retry limits
v File transfer protocol
The settings return to the defaults as defined in the [Link] file format when the user exits ATE.
When issued without flags from either of the ATE main menus, the alter subcommand displays the Alter
Menu. To bypass the Alter Menu, enter the alter subcommand, followed by the appropriate flags, at the
command prompt on either ATE main menu.
The alter subcommand can change more than one feature at a time. To change the value of more than
one variable, type the first flag followed by the new value, followed by a space, then the second flag and
second value, and so on.
To permanently change the settings affected by the alter subcommand, customize the [Link] file format.
The Alter Menu: The Alter Menu displays the current settings of the changeable characteristics with the
alter subcommand. Enter the letter a after the command prompt on either the ATE Connected or
Unconnected Main Menu to view the Alter Menu.
To change the value of a variable, enter the flag (from the COMMAND column) and new value (from the
POSSIBLE CHOICES column) at the command prompt on the Alter Menu.
To return to one of the ATE main menus from the Alter Menu, press the Enter key.
Flags:
a RedialAttempts Specifies the maximum number of times the ATE program redials for a
connection. If the RedialAttempts variable is 0, no redial attempt occurs.
Default: 0
Note: The PacingType variable has no effect when the xmodem protocol is
used.
Options: Locally created port names. The first 8 characters of the port name
display in the Alter Menu.
Default: tty0
f DialSuffix Specifies the dial suffix that must follow the telephone number when autodialed
with a modem. Consult the modem documentation for the proper dial command.
Options: 0 (none) or a valid modem suffix. The first 8 characters display in the
Alter Menu.
Default: no default
i DialPrefix Specifies the dial prefix that must precede the telephone number when autodialed
with a modem. Consult the modem documentation for the proper dial commands.
Options: ATDT, ATDP, or other values depending on the type of modem used. The
first 8 characters display in the Alter Menu.
Default: ATDT
l CharacterLength Specifies the number of bits in a data character. This length must match the
length expected by the remote system.
Options: 7 or 8
Default: 8
p Parity Checks whether a character was successfully transmitted to or from a remote
system. Must match the parity of the remote system.
For example, if the user selects even parity, when the number of 1 bits in the
character is odd, the parity bit is turned on to make an even number of 1 bits.
Default: 0
Options: 50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, or
19200
Default: 1200
s StopBit Specifies the number of stop bits appended to a character to signal the end of
that character during data transmission. This number must match the number of
stop bits used by the remote system.
Options: 1 or 2
Default: 1
t TransferProtocol Defines the type of asynchronous protocol that transfers files during a connection.
p File transfer protocol controls the data transmission rate by waiting for
either a specified character or a certain number of seconds between line
transmissions. This helps prevent loss of data when the transmission
blocks are either too large or sent too quickly for the system to process.
x An 8-bit file transfer protocol to detect data transmission errors and
retransmit the data.
Default: p
w Seconds wait
Specifies the number of seconds between redial attempts. The wait period does
not begin until the connection attempt times out or until it is interrupted. If the
attempts flag is set to 0, no redial attempt occurs.
Default: 0
Examples:
1. To display the Alter Menu, enter the alter subcommand at the command prompt on either ATE main
menu:
a
For the current session of ATE, the baud rate is changed to 9600 bps.
v To change the value of the wait flag, enter:
w 7
For the current session of ATE, the wait time for redial changes to 7 seconds.
v To bypass the Alter Menu when using the alter command, type the command abbreviation a, followed
by the appropriate flags, at the prompt on one of the ATE main menus. For example, to change the
rate, wait, and attempt values, enter the following at the prompt on either ATE main menu:
a r 9600 w 5 a 1
break Subcommand
b
The break subcommand sends a break signal to the remote system connected to the terminal by the
Asynchronous Terminal Emulation (ATE) program. The break subcommand interrupts current activity on
the remote system. Issue the break subcommand from the ATE Connected Main Menu.
Attention: The break subcommand may disconnect the current session. The system may lose data.
Example: To interrupt the current session, at the remote system login screen, press the
MAINMENU_KEY (usually the Ctrl-V key sequence). When the ATE Connected Main Menu displays, enter:
b
A break signal is sent to the remote system, and the ATE Unconnected Main Menu displays. Now exit the
ATE program or issue other ATE subcommands.
connect Subcommand
c [ TelephoneNumber | PortName ]
The ATE connect subcommand enables users to connect to a remote computer using Asynchronous
Terminal Emulation (ATE). Issue the connect subcommand from the ATE Unconnected Main Menu. The
connection can be made between two machines connected by cable or by telephone line. Users establish
connection in one of three ways:
If the system login is not disabled, attempts to connect to another computer return an error. To disable the
workstation port that handles system login by remote users, a user with root authority must use the
pdisable command. Once the workstation port is secure from remote logins, the user must then ensure
the remote system is ready to receive calls.
No connection is established if the line is busy, if the party does not answer, or if the user specified an
unrecognized number. If any of these conditions exist, a message is displayed.
If a busy signal is received while trying to connect to a remote workstation, press the PREVIOUS_KEY
(usually the Ctrl-R key sequence), and enter the TelephoneNumber parameter again.
Once the connection is established, ATE displays a message indicating the name of the port used for the
connection.
Parameters:
PortName Specifies the name of the port used for a direct connection.
TelephoneNumber Specifies the telephone number used to establish a modem connection.
Examples:
1. To establish a direct connection, at the command line of the ATE Unconnected Main Menu, enter:
c tty0
The ATE program prompts the user for information necessary to establish a manually dialed
connection, such as a telephone number or modem to use. After connection is established, ATE
displays a message giving the port name used for the connection, followed by a login screen. Enter
the requested login information and press the MAINMENU_KEY (usually the Ctrl-V key sequence) to
display the ATE Connected Main Menu.
3. To establish an automatically dialed connection, at the command line of the ATE Unconnected Main
Menu, enter:
c 2229999
This example dials the telephone number 222-9999. After connection is established, a message
displays indicating the port used for the connection, followed by a login screen. Enter the requested
login information and press the MAINMENU_KEY (usually the Ctrl-V key sequence) to display the ATE
Connected Main Menu.
directory Subcommand
d
The ATE directory subcommand displays a dialing directory. Users establish a connection to a remote
computer by selecting one of the directory entries from the displayed directory. The directory
subcommand is issued from the ATE Unconnected Main Menu. The directory subcommand uses the
information contained in the dialing directory to establish an automatically dialed (modem-dialed)
connection.
When ATE starts, it checks the current directory for an [Link] file format. If an [Link] file format does not
exist in the current directory, it creates one. The initial location of the dialing directory is /usr/lib/dir, but
this value can be changed by Editing the ATE default file the [Link] file format. If users specify a different
dialing directory in the [Link] file format, that directory is used.
The dialing directory contains entries for remote systems called with the ATE program in the format:
These fields give the name of the entry (usually the person or company whose computer the phone
number reaches), the telephone number, and other information the ATE program uses to establish the
connection.
See ″Dialing Directory File Format for ATE″ in AIX 5L Version 5.3 Files Reference for more information
about dialing directory entries.
When an entry displays on the screen using the directory subcommand, the entry is preceded by an entry
number. Select the entry to establish a connection to by entering its entry number in response to a prompt.
Example: To display a dialing directory, at the command line of the Unconnected Main Menu, enter:
d
The dialing directory specified in the [Link] file format displays and prompts the user for an entry number.
Enter the number of the dialing directory entry to establish a connection with. ATE establishes the
connection and displays a message indicating the port name used.
help Subcommand
h[a][b][c][d][m][p][q][r][s][t]
The ATE help subcommand provides help information for the ATE subcommands. Issue the help
subcommand from either the Unconnected or Connected Main Menu of ATE. Help information is available
for all the ATE subcommands, and can be requested for several subcommands at the same time.
When issuing the help subcommand, ATE displays a description of each subcommand requested and
instructions for using the subcommand. Help information for each subcommand displays individually, in the
order requested. After reading each help message, press Enter to view the next page of help text. At the
end of the help text, press Enter to return to the main menu.
Issue the help subcommand with the first letter of an ATE subcommand for help information. These are
the names for the ATE subcommands:
Examples:
1. To receive help information for a single subcommand, enter the following at one of the ATE main
menus:
h c
Help information displays for the connect (c) subcommand. After viewing the help information, press
the Enter key, and ATE displays the menu from which the help subcommand was issued.
2. To receive help information for multiple subcommands, enter the following at one of the ATE main
menus:
h r s
The help information for the receive subcommand (r) displays first. After viewing the help information,
press the Enter key. Help information for the send subcommand (s) displays. After viewing the help
information, press the Enter key, and ATE displays the menu from which the help subcommand was
issued.
modify Subcommand
m [ n CaptureFileName ] [ e ] [ l ] [ v ] [ w ] [ x ]
Note: The default CaptureFileName and the initial settings of the other modify subcommand flags
can be permanently changed in the [Link] file format.
The modify subcommand is accessed from the Asynchronous Terminal Emulation (ATE) Connected or
Unconnected Main Menu. The modify subcommand temporarily changes how ATE functions on the local
system in the following ways:
v Changes the name of the capture file that receives incoming data.
140 Commands Reference, Volume 1
v Switches (toggles) the following features on or off:
– Add a line-feed character at the end of each line of incoming data.
– Use echo mode.
– Emulate a DEC VT100 terminal at the console.
– Write incoming data to a capture file as well as to the display.
– Use an Xon/Xoff (transmitter on/off) signal.
The settings return to the default values as defined in the [Link] file format when the user exits ATE.
When issued without flags from either of the ATE main menus, the modify subcommand displays the
Modify Menu. The Modify Menu can be bypassed by entering m (the modify subcommand abbreviation),
followed by the appropriate flags, at the command prompt on either ATE main menu.
The modify subcommand can change more than one feature at a time. To change the name variable,
enter the n flag followed by the new file name. All other variables are switches that can be turned on or off
by typing the flag. Typing the flag switches, or toggles, the value.
To permanently change the settings affected by the modify subcommand, customize the [Link] file
format in the directory running ATE.
Modify Menu: The Modify Menu displays the current settings of the features changeable with the modify
subcommand. To display the Modify Menu, enter the letter m after the command prompt on either the ATE
Connected Main Menu or the ATE Unconnected Main Menu.
To change the value of a flag other than the name flag, enter the flag (from the COMMAND column) at the
command prompt on the Modify Menu. The flag value toggles to the alternate setting. To change the name
of the capture file, enter the letter n (the name flag), followed by the new file name, at the prompt on the
Modify Menu.
To return to the ATE Connected or Unconnected Main Menu from the Modify Menu, press the Enter key.
Flags:
e echo
With a remote computer that supports echoing, each character sent returns and
displays on the screen. When the echo flag is on, each character is displayed
twice: first when it is entered and again when it returns over a connection. When
the echo flag is off, each character displays only when it returns over the
connection.
Options: On or off
Default: Off
Options: On or off
Default: Off
n CaptureFileName name
Specifies the file name for incoming data when the write flag is on, or when the
CAPTURE_KEY (usually the Ctrl-B key sequence) is pressed during a connection.
Options: Any valid file name. The first 18 characters display in the Modify Menu.
Default: capture
v VT100
The local console emulates a DEC VT100 terminal so DEC VT100 codes can be
used with the remote system. With the VT100 flag off, the local console functions
like a workstation.
Options: On or off
Default: Off
Routes incoming data to the capture file (specified by the name flag) as well as to
the display. The write command functions like the CAPTURE_KEY key sequence
during a connection. Carriage return and line-feed combinations are converted to
line-feed characters before being written to the capture file. In an existing file, data
is appended to the end of the file.
Options: On or off
Default: Off
x Xon/Xoff
Options: On or off
Default: On
Note: If you use a variable value with any flag other than the name flag, the
following error message displays:
828-003 not ’command-name’ command is not valid.
Enter the first letter of a command
from the list on the menu.
This error message indicates either an incorrect letter was entered or a value
that is not valid was included.
The values of the linefeed and echo flags are switched to the alternate settings. Display the Modify
Menu to view the current settings of the flags.
v To change the name variable to schedule and toggle the values of the write and Xon/Xoff flags, at
the prompt on either ATE main menu enter:
m n schedule w X
Any data saved is now put into the schedule file, and the values of the write and Xon/Xoff flags are
switched to the alternate settings. Display the Modify Menu to view the settings of the flags.
perform Subcommand
p [ Command ]
The ATE perform subcommand allows the user to issue workstation operating system commands while
using Asynchronous Terminal Emulation (ATE). Issue the perform subcommand from the ATE
Unconnected or Connected Main Menu. Command specifies a valid workstation operating system
command.
Examples:
1. To issue a workstation operating system command, at the command line of the ATE Unconnected or
Connected Main Menu, enter:
p
ATE prompts the user to enter a command. ATE executes the specified command. After the command
finishes, ATE displays the menu from which the perform subcommand was issued.
2. To specify the command to be executed, at the command line of the ATE Unconnected or Connected
Main Menu, enter:
p cat mystuff
ATE executes the cat command, which displays the mystuff file. After the cat command finishes, ATE
displays the menu from which the perform subcommand was issued.
The ATE quit subcommand exits the Asynchronous Terminal Emulation (ATE) program. Issue the quit
subcommand from the ATE Unconnected or Connected Main Menu. Issuing the quit subcommand ends
the ATE program and displays the command prompt.
Example: To exit the ATE program, from the command line of either ATE main menu, enter:
q
receive Subcommand
r FileName
The ATE receive subcommand enables your system to receive a file from a remote system. The ATE
receive subcommand is issued from the ATE Connected Main Menu.
The ATE receive subcommand uses the xmodem file transfer protocol, which enables your system to
receive data from a remote system, a block at a time, with error checking. The remote system must be set
to send the file before your system can receive. Use the xmodem command with the -s flag on the remote
system to enable the remote system to send the file. Then issue the receive subcommand. FileName
names the file where the received data is stored.
Example: To receive a file sent from the remote system, at the command line of the ATE Connected
Main Menu, enter:
r myfile
The data is received from the remote system and is stored in the myfile file.
send Subcommand
s [ FileName ]
The ATE send subcommand sends a file to a remote system. Issue the ATE send subcommand from the
ATE Connected Main Menu once a connection is established. The ATE connect subcommand establishes
the connection and prepares the remote system to receive files.
The send subcommand uses the xmodem file transfer protocol, sending data to a remote system, a block
at a time, with error checking. Issue the xmodem command with the -r flag on the remote system to
enable the remote system to receive the file. Then issue the send subcommand. FileName names the file
to send to the remote system.
Examples:
1. To send a file to a remote system, at the command line of the ATE Connected Main Menu, enter:
s
ATE prompts the user for the name of the file to send to the remote system.
2. To specify a file to send to the remote system, at the command line of the ATE Connected Main Menu,
enter:
s mystuff
terminate Subcommand
t
Example: To terminate the current session, from the remote system login screen, press the
MAINMENU_KEY (usually the Ctrl-V key sequence). When the ATE Connected Main Menu displays, enter:
t
A terminate signal is sent to the remote system, the session ends, and ATE displays the Unconnected
Main Menu. Now issue other ATE subcommands or exit ATE.
File
/usr/lib/dir Contains the default dialing directory.
Related Information
The [Link] file format contains ATE default values.
ATE main menus in Networks and communication management describes the ATE program, its menus,
and its control keys.
Editing the ATE default file in Networks and communication management explains how to permanently
change ATE defaults.
atmstat Command
Purpose
Shows Asynchronous Transfer Mode adapters statistics.
Syntax
atmstat [ -d -r ] Device_Name
Description
The atmstat command displays Asynchronous Transfer Mode (ATM) adapter statistics. The user can
optionally specify that the device-specific statistics be displayed in addition to the device generic statistics.
If no flags are specified, only the device generic statistics are displayed. For information on statistic from
the atmstat command, see ATM adapter statistics in the Networks and communication management.
If an invalid Device_Name is specified, the atmstat command produces an error message stating that it
could not connect to the device.
Flags
-d Displays detailed statistics.
-r Resets all the statistics back to their initial values. This flag can only be issued by privileged users.
Parameters
Device_Name The name of the ATM device, for example, atm0.
This produces the following output on a Micro Channel machine in AIX 5.1 and earlier:
ATM STATISTICS (atm0) :
Device Type: Turboways 155 MCA ATM Adapter
Hardware Address: [Link]
Elapsed Time: 2 days 23 hours 38 minutes 18 seconds
General Statistics:
-------------------
No mbuf Errors: 0
Adapter Loss of Signals: 0
Adapter Reset Count: 0
Driver Flags: Up Running Simplex
64BitSupport
Virtual Connections in use: 2
Max Virtual Connections in use: 2
Virtual Connections Overflow: 0
SVC UNI Version: auto_detect
-------------------- -------------------
Packets: 299 Packets: 294
Bytes: 9727 Bytes: 10123
Interrupts: 0 Interrupts: 297
Transmit Errors: 0 Receive Errors: 0
Packets Dropped: 0 Packets Dropped: 0
Bad Packets: 0
Max Packets on S/W Transmit Queue: 0
S/W Transmit Queue Overflow: 0
Current S/W+H/W Transmit Queue Length: 2
General Statistics:
-------------------
No mbuf Errors: 0
Adapter Loss of Signals: 0
Adapter Reset Count: 0
Driver Flags: Up Running Simplex
64BitSupport
Virtual Connections in use: 4
Max Virtual Connections in use: 5
Virtual Connections Overflow: 0
SVC UNI Version: uni3.1
Related Information
The entstat command, fddistat command, netstat command, tokstat command.
atq Command
Purpose
Displays the queue of jobs waiting to be run.
Syntax
atq [ c | -n ] [ User ... ]
Description
The atq command displays the current user’s queue of jobs that are waiting to be run at a later date,
sorted in the order the jobs will be run. These jobs were created with the at command. If the user is root
and User name is specified, the atq command displays only jobs belonging to that user.
Examples
In order to look at the queue created by the at command, enter:
atq
If there are jobs in the queue, a message similar to the following appears:
root.635623200.a Wed Feb 21 [Link] 1990
root.635670000.a Thu Feb 22 [Link] 1990
Files
/usr/bin/atq Contains the atq program.
/var/spool/cron/atjobs Specifies the spool area.
Related Information
The at command, atrm command.
Input and output redirection overview in Operating system and device management describes how the
operating system processes input and output.
Shells in Operating system and device management describes what shells are, the different types of
shells, and how shells affect the way commands are interpreted.
atrm Command
Purpose
Remove jobs spooled by the at command.
Syntax
atrm [ -f ] [ -i] [ -a | - ] [ Job ... | User ... ]
Description
The atrm command removes jobs that were created with the at command, but have not executed. If one
or more job numbers is specified, the atrm command attempts to remove only those jobs.
If one or more user names is specified, all jobs belonging to those users are removed. This form of
invoking the atrm command is useful only if you have root user authority.
Flags
- Removes all jobs belonging to the user invoking the atrm command.
-a Removes all jobs belonging to the user invoking the atrm command. This flag is provided for System V
compatibility.
-f Suppresses all information about the jobs being removed.
Examples
To remove job number root.62169200.a from the at command queue, enter:
atrm root.621619200.a
Files
/usr/bin/atrm Contains the atrm program file.
/var/spool/cron/atjobs Specifies the spool area.
Related Information
The at command, atq command.
Input and output redirection overview in Operating system and device management describes how the
operating system processes input and output.
Shells in Operating system and device managementdescribes what shells are, the different types of shells,
and how shells affect the way commands are interpreted.
attachrset Command
Purpose
Attaches an rset to a process.
Syntax
attachrset [ -P ] [ -F ] [ -S ] rsetname pid
or
attachrset [ -P ] [ -F ] [ -c CPUlist ] [ -m MEMlist ] pid
Description
The attachrset command attaches an rset to a process. The command limits the specified process to run
only on the processors and/or memory regions contained in the rset. An rset name in the system registry
can be attached to the process. Or, an rset containing the specified processors and memory regions can
be attached to the process.
Flags
-P Attaches an rset as a partition rset.
-F Forces the rset attachment to occur. This option will remove a bindprocessor bind and all threads’
rset in the process before attaching the new rset. If the -P option is also specified, it will also detach
the effective all threads’ rset from the process before attaching the new rset.
-c CPUlist List of CPUs to be in the rset. This can be one or more CPUs or CPU ranges.
-m MEMlist List of memory regions to be in the rset. This can be one or more memory regions or ranges.
Parameters
rsetname The name of the rset to be attached to the process. The name consists of a namespace and
an rsname separated by a ″/″ (slash). Both the namespace and rsname may contain up to
255 characters. See the rs_registername() service for additional information about character
set limits of rset names.
pid Process ID to connect rset.
Security
The user must have root authority or have CAP_NUMA_ATTACH capability and read access to the
specified rset registry name (if -r option used) and target process must have the same effective userid as
the command issuer. The user must have root authority to set the partition rset on a process (the -P
option).
Examples
1. To attach an rset containing CPUs 0-7 to process 18838, type:
attachrset -c 0-7 18838
2. To attach rset named test/cpus0to7 to process 20124, type:
attachrset test/cpus0to7 20124
Files
/usr/bin/attachrset Contains the attachrset command.
Related Information
The detachrset, execrset, lsrset, mkrset, and rmrset commands.
audit Command
Purpose
Controls system auditing.
Syntax
audit { start | shutdown }
audit query
Description
The audit command controls system auditing through its several keywords. One keyword must be
included each time the command is given. The start keyword and the shutdown keyword start and stop
The auditing system follows the instructions established in the following configuration files:
v /etc/security/audit/config
v /etc/security/audit/events
v /etc/security/audit/objects
v /etc/security/audit/bincmds
v /etc/security/audit/streamcmds
Each of these files is described in ″Files″ section . For information on configuring the audit system, see
″Setting up Auditing″ in Operating system and device management.
Keywords
start Starts the audit subsystem. The command reads the instructions in the configuration files and
does the following:
object auditing
Writes the audit event definitions in the /etc/security/audit/objects file into the kernel
to define the object auditing events.
event auditing
Writes the audit class definitions in the /etc/security/audit/config file into the kernel
to define the audit classes.
bin auditing
Starts the auditbin daemon according to the configuration information in the bin
stanza in the /etc/security/audit/config file, if the start stanza contains binmode=on.
stream auditing
Invokes the audit stream commands as defined in the stream stanza in the
/etc/security/audit/config file, if the start stanza contains streammode=on.
Attention: Invocation of stream auditing from /etc/inittab should be avoided.
user auditing
Audits all users currently logged in to the system, if they are configured in the users
stanza of the /etc/security/audit/config file.
audit logging
Enables the audit logging component as defined in the start stanza in the
/etc/security/audit/config file.
shutdown Terminates the collection of audit records and resets the configuration information by removing
the definition of classes from the kernel tables. All the audit records are flushed from the kernel
buffers into the bin files or audit streams, according to the specifications for the backend
commands, which are contained in the /etc/security/audit/bincmds file for binmode auditing,
and in the /etc/security/audit/streamcmds file for streammode auditing. The collection of audit
data stops until the next audit start command is given.
off Suspends the auditing system, but leaves the configuration valid. Data collection pauses until the
audit on command is given.
on [panic] Restarts the auditing system after a suspension, if the system is properly configured (for
example, if the audit start command was used initially and the configuration is still valid). If
auditing is already started when the command is given, only bin data collection can be changed.
If you specify the panic option, the system will halt abruptly if bin data collection is enabled but
cannot be written to a bin file.
audit events:
audit class: audit event, audit event...
audit objects:
object name: object mode: audit event
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Files Accessed:
Mode File
r /etc/security/audit/config
r /etc/security/audit/objects
x /usr/sbin/auditbin
x /usr/sbin/auditstream
Examples
1. To start the audit process, configure the audit system as described in ″Setting up Auditing″ in Security,
and add the following line to the system initialization file (the /etc/rc file):
/usr/sbin/audit start 1>&- 2>&-
The audit process starts, as configured, each time the system is initialized.
2. To terminate the operation of the auditing process, enter:
/usr/sbin/audit shutdown
Data collection stops until the audit start command is given again. The configuration of classes in the
operating system kernel is lost.
Note: The audit shutdown command should be in the /etc/shutdown file as well.
3. To suspend the audit subsystem, enter:
/usr/sbin/audit off
4. To restart an audit process that was suspended by the audit off command, enter:
/usr/sbin/audit on
The suspended state ends and audit records are generated again, as long as the system is configured
correctly.
5. To display the current status of the auditing system, enter:
/usr/sbin/audit query
audit events:
authentication- USER_Login, USER_Logout
administration- USER_Create, GROUP_Create
The query tells you that audit records will be written when the specified users log in or log out, when
the specified administrators create a user or a group, and when the system receives an authorized
read or write instruction for the /etc/security/passwd file.
Files
/usr/sbin/audit Contains the path of the audit command.
/etc/rc Contains the system initialization commands.
/etc/security/audit/config
Contains audit configuration information.
/etc/security/audit/events
Lists the audit events and their tail format specifications.
/etc/security/audit/objects
Lists the audit events for each file (object).
/etc/security/audit/bincmds
Contains shell commands for processing audit bin data.
/etc/security/audit/streamcmds
Contains auditstream commands.
Related Information
The auditbin daemon, auditcat command, auditconv command, auditpr command, auditselect
command, auditstream command, login command, logout command, su command.
The audit subroutine, auditbin subroutine, auditevents subroutine, auditlog subroutine, auditproc
subroutine.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
To see the steps you must take to establish an Auditing System, refer to Setting up Auditing in Security.
auditbin Daemon
Purpose
Manages bins of audit information.
Syntax
auditbin
Description
The auditbin daemon in the audit subsystem manages bin1 and bin2, temporary bin files that alternately
collect audit event data. The command also delivers bins of data records to backend commands for
processing.
The auditbin daemon ensures that each command encounters each bin at least once, but does not
synchronize access to the bins. When all the commands have run, the bin file is ready to collect more
audit records.
If a command is unsuccessful, the auditbin daemon stops delivering data records and sends a message
to the /dev/tty device every 60 seconds until the root user or a member of the audit group stops the
command.
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Files Accessed:
Mode File
r /etc/security/audit/config
r /etc/security/audit/bincmds
rw Defined audit bins and trail file
x All audit bin processing commands
Examples
1. To configure the auditbin daemon, edit the start and bin stanzas of the /etc/security/audit/config file
to include the following attribute definitions:
start:
binmode = on
bin:
trail = /audit/trail
bin1 = /audit/bin1
bin2 = /audit/bin2
binsize = 25000
cmds = /etc/security/audit/bincmds
2. To define the commands that process the audit trail, edit the /etc/security/audit/bincmds file to
include one or more command lines, such as the following:
/usr/sbin/auditcat -p -o $trail $bin
The first command line appends compressed audit bins to the audit trail file. The second line selects
USER_Login records from each bin file, passes them to the auditpr command for formatting, and
appends the records to the /etc/log file.
Files
/usr/sbin/auditbin Specifies the path to the auditbin daemon.
/audit/binx Specifies the path to the default bin collection files, with x
indicating the bin number.
Related Information
The audit command, auditcat command, auditconv command,auditpr command, auditselect command,
auditstream command.
To see the steps you must take to establish an Auditing System, refer to Setting up Auditing in Security.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
auditcat Command
Purpose
Writes bins of audit records.
Syntax
auditcat [ -p | -u ] [ -o OutFile ] [ -r ] [ InFile ]
Description
The auditcat command is part of the audit subsystem, and is one of several backend commands that
process the audit data records.
The auditcat command reads bin files of audit records from standard input or from the file specified by the
InFile parameter. The command then processes the records and writes its output to standard output or to
the file specified by the 0utFile parameter. The output can be compressed or not, depending on the flag
selected.
One major use of the command is appending compressed bin files to the end of the system audit trail file.
If the /etc/security/audit/bincmds file includes $bin as the input file, input comes from the current bin file,
bin1 or bin2. If the /etc/security/audit/bincmds file includes $trail as the output file, the records are
written to the end of the system audit trail file.
If a bin file is not properly formed with a valid header and tail, an error is returned. See the auditpr
command for information about audit headers and tails and the auditbin command for information on error
recovery.
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Examples
To configure the system to append audit bin data to the system audit trail file, add the following line to the
/etc/security/audit/bincmds file:
When the auditbin daemon calls the auditcat command, the daemon replaces the $bin string with the
path name of the current bin file, and replaces the $trail string with the name of the default audit trail file.
Files
/usr/sbin/auditcat Specifies the path to the auditcat command.
/etc/security/audit/config Contains audit system configuration information.
/etc/security/audit/events Contains the audit events of the system.
/etc/security/audit/objects Contains audit events for audited objects (files).
/etc/security/audit/bincmds Contains auditbin backend commands.
Related Information
The audit command, auditconv command, auditpr command, auditselect command.
auditbin daemon.
To see the steps you must take to establish an Auditing System, refer to Setting up Auditing inSecurity.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
auditconv Command
Purpose
Converts pre-AIX Version 4 format audit bins to AIX Version 4 format.
Description
The auditconv command converts audit records which were generated by previous versions of the
operating system into the format used by AIX Version 4 and higher of the operating system.
Audit records are read from the file OldFile, and written to the file NewFile. Each audit record is updated
with thread information, with a default thread identifier of zero.
Notes:
1. The OldFile and NewFile parameters must be different, and must not be currently in use by the audit
system.
2. AIX Version 4 and higher of the operating system cannot work with pre-AIX Version 4 audit bins.
Therefore, old bins must be converted using the auditconv command.
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Files Accessed:
Mode File
r /etc/security/audit/events
r /etc/passwd
r /etc/group
Example
To convert the old audit file pre_v4_auditbin, storing the results in converted_auditbin, enter the
following command:
Files
/usr/sbin/auditconv Specifies the path of the auditconv command.
/etc/security/audit/config Contains audit system configuration information.
/etc/security/audit/events Contains the audit events of the system.
/etc/security/audit/objects Contains information about audited objects (files).
/etc/security/audit/bincmds Contains auditbin backend commands.
/etc/security/audit/streamcmds Contains auditstream commands.
Related Information
The audit command, auditbin daemon, auditcat command, auditpr command, auditselect command,
auditstream command.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
auditmerge Command
Purpose
Combines multiple audit trails into a single trail.
Syntax
/usr/sbin/auditmerge [ -q ] file [ file ... ]
Description
The auditmerge command combines multiple audit trail files from potentially multiple machines into a
single audit trail file. For each file with records remaining, the record that has the oldest time stamp is
added to the output. If a record is found that has a negative time change, an optional warning message
may be emitted. Processing continues and any such records are output with their time values unmodified.
The auditmerge command also is capable of adding CPU ID values from the bin header to each output
record. The CPU ID value is encoded in the bin header and trailer for bins with a version number more
recent than AIX 4.3.1.
The -q flag is used to control outputting warning messages. When a record with a negative time change is
first seen, a single warning message is output. That message contains the name of the file containing the
record and the time difference. These messages are suppressed when the -q flag is given on the
command line.
Flags
-q Used to control outputting warning messages.
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Examples
1. To merge two existing audit trails files from different hosts, enter:
/usr/bin/auditmerge /audit/[Link] /audit/[Link] > /audit/[Link]
2. To merge two existing data files which were preselected for different user names, enter:
/usr/bin/auditmerge /audit/[Link] /audit/[Link] > /audit/[Link]
3. To merge two data files without producing warnings about incorrect times, enter:
/usr/bin/auditmerge -q /audit/jumbled.1 /audit/jumbled.2 > /audit/[Link]
Files
/etc/security/audit/hosts Contains the CPU ID to hostname mappings.
Related Information
The auditpr command, auditstream command, auditselect command.
Purpose
Formats bin or stream audit records to a display device or printer.
Syntax
auditpr [ -t 0 | 1 | 2] [ -m Message ] [ -r ] [ -v ] [ -h field[,field]*]
Description
The auditpr command is part of the audit subsystem. This command reads audit records, in bin or stream
format, from standard input and sends formatted records to standard output.
The output format is determined by the flags that are selected. If you specify the -m flag, a message is
displayed before each heading. Use the -t and -h flags to change the default header titles and fields and
the -v flag to append an audit trail. The auditpr command searches the local /etc/passwd file to convert
user and group IDs to names.
For examples of audit trails, see the /etc/security/audit/events file where audit trail formats are defined.
Invalid records are skipped when possible, and an error message is issued. If the command cannot
recover from an error, processing stops.
Flags
-h field[,field]* Selects the fields to display and the order in which to display them, by default e, l, R, t,
and c. You can specify the following values:
e The audit event
l The login name of the user
R The audit status
t The time the record was written
c The command name
r The real user name
p The process ID
P The ID of the parent process.
T The kernel thread ID. This is local to the process; different processes may
contain threads with the same thread ID.
h The name of the host that generated the audit record. If there is no CPU ID in
the audit record, the value none is used. If there is no matching entry for the
CPU ID in the audit record, the 16 character value for the CPU ID is used
instead.
-m ″Message″ Specifies a Message to be displayed with each heading. You must enclose the Message
string in double quotation marks.
-r Suppresses ID translation to the symbolic name.
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Files Accessed:
Mode File
r /etc/security/audit/events
r /etc/passwd
r /etc/group
Examples
1. To read the system audit trail file with default header titles and fields and an audit trail, enter:
The resulting record is formatted with the default values ( e, c, l, R, and t) and includes a trail.
3. To read records interactively from the audit device, enter:
/usr/sbin/auditstream | /usr/sbin/auditpr -t0 -heRl
Files
/usr/sbin/auditpr Specifies the path of the auditpr command.
/etc/security/audit/config Contains audit system configuration information.
/etc/security/audit/events Contains the audit events of the system.
/etc/security/audit/objects Contains audit events for audited objects (files).
/etc/security/audit/bincmds Contains auditbin backend commands.
/etc/security/audit/streamcmds Contains auditstream commands.
/etc/security/audit/hosts Contains the CPU ID to host name mappings.
Related Information
The audit command, auditcat command, auditconv command, auditselect command, auditstream
command.
To see the steps you must take to establish an Auditing System, refer to Setting up Auditing in Security.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
auditselect Command
Purpose
Selects audit records for analysis according to defined criteria.
Syntax
auditselect { -e ″Expression″ | -f File} [ -m ] [ Trail ]
Description
The auditselect command is part of the audit subsystem. The command is called by the auditbin daemon
if it is configured in the /etc/security/audit/bincmds file as a backend command for processing bin files.
The auditselect command selects audit records that match identified criteria and writes the records to
standard output. With the auditselect command, you can filter the audit trail to obtain specific records for
analysis or select specific records for long-term storage. The command takes stream or bin input from the
file specified by the Trail parameter or from standard input. If you specify the $bin string as the value of
the Trail parameter, the auditbin daemon substitutes the path name of the current bin file when it calls the
auditselect command. The selection criteria can be entered as an expression or from the file specified by
the -f flag. If the bin files are compressed, the auditselect command unpacks them prior to processing.
For stream data, configure both the auditstream command and the auditselect command in the
/etc/security/audit/streamcmds file, or enter both commands from the command line.
Flags
-e ″Expression″ Defines the selection criteria. The Expression parameter consists of one or more terms
joined by logical operators.
-f File Specifies the File that contains the selection criteria.
-m Specifies the output audit record with record extensions.
Creating Expressions
A valid expression consists of one or more terms joined by logical operators.
Logical Operators
Logical operators allow more than one term to be used in an expression. Normal precedence rules apply
in evaluating expressions with more than one logical operator, and parentheses may be used to force the
order of evaluation. The valid logical operators include the following:
&& (And) The expression term1 && term2 is true (selected) if both term1 and term2 are true.
|| (Or) The expression term1 || term2 is true (selected) if either term1 or term2 is true.
! (Not) The expression !term1 is true (selected) if term1 is not true.
Fields
Fields correspond to the information in the audit header of each record. Valid values for fields include the
following:
Relational Operators
Relational operators are used to compare the field in the audit record to the specified value. Valid
relational operators include:
== Equal to
!= Not equal to
< Less than
> Greater than
>= Greater than or equal to
<= Less than or equal to
Valid Terms
A valid term consists of a field, a relational operator, and a value. In addition, not all relational operators
and values are valid for each field. The following are the valid combinations:
Security
Access Control: This command should grant execute (x) access to the root user and members of the audit
group. The command should be setuid to the root user and have the trusted computing base attribute.
Examples
Configuration
1. To select bin-collected data records that match the USER_SU or USER_Login audit events, add the
auditselect command to the /etc/security/audit/bincmds file by entering:
/usr/sbin/auditselect -e "event== USER_SU || event== \
USER_Login" $bin >> /audit/[Link]
While auditing is enabled, the records for each initiation of a user session are read from the current bin
file and written to the /audit/[Link] file.
2. To select stream-collected data records that match a user login that was unsuccessful, add the
auditselect command to the auditstream stanza in the /etc/security/audit/streamcmds file by
entering:
/usr/sbin/auditstream -c authentication | \
/usr/sbin/auditselect -e "event == \
USER_Login && result == FAIL" | \
/usr/sbin/auditpr -t 2 -v >> /dev/lpr2
To produce a hardcopy audit trail, records of unsuccessful authentication events are written to the
/dev/lpr2 line printer.
The records of events that were unsuccessful because authentication was denied are printed. The
header titles will be printed once, followed by the event, login ID, and time fields, and then the audit
trail.
2. To select audit records that are generated when smith logs in during prime working hours during the
first week in May of 1987, enter:
/usr/sbin/auditselect -f /aaa/bbb \
/audit/trail1987 | /usr/sbin/auditpr
"event != USER_Login"
2. To find out if the passwd command generated the audit event, use:
"command == passwd"
To find out if the audit event was not generated by the passwd command, use:
"command != passwd"
3. To compare the audit status to the OK result string, enter:
"result == OK"
4. To compare the login or real user ID of the process that generated the audit event to a specific user ID
(user ID 014 or the user name carol), enter one of the following:
"login == 014"
"login != carol"
"login == 014 || login != carol"
"real == carol"
5. To compare the ID of the process or the parent of the process that generated the audit event to the
process ID 2006, enter one of the following:
"pid == 2006"
"pid != 2006"
"ppid == 2006"
Note: Although login and real user IDs and process IDs can be compared with the inequality
operators ( < =, > =, <, > ), it is normally unnecessary to do this.
6. To compare the time the audit event was generated to the [Link] time string, enter one of the
following:
"time == [Link]"
"time != [Link]"
"time < [Link]"
"time <= [Link]"
"time > [Link]"
"time >= [Link]"
Audit records are selected that fit the indicated comparison to the [Link] time string. The time string
must agree with the format specified by the current locale.
7. To compare the date that the audit event was generated to the 05/05/89 date string, enter one of the
following:
"date == 05/03/89"
"date != 05/03/89"
"date < 05/03/89"
"date <= 05/03/89"
"date > 05/03/89"
"date >= 05/03/89"
Audit records are selected that fit the indicated comparison to the 05/05/89 date string. The date string
must agree with the format specified by the current locale.
Files
/usr/sbin/auditselect Specifies the path of the auditselect command.
/etc/rc Contains the system initialization commands.
/etc/security/audit/config Contains audit system configuration information.
/etc/security/audit/events Contains the audit events of the system.
Related Information
The audit command, auditcat command, auditconv command, auditpr command, auditstream
command, env command.
auditbin daemon.
To see the steps you must take to establish an Auditing System, refer to Setting up Auditing in Security.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
auditstream Command
Purpose
Creates a channel for reading audit records.
Syntax
auditstream [ -m ] [ -c Class ...]
Description
The auditstream command is part of the audit subsystem. This command reads audit records from the
/dev/audit file (the audit device) and copies the records to standard output in binary format. You can select
a subset of the audit records by specifying audit classes (defined in the /etc/security/audit/config file)
with the -c flag; otherwise, all currently enabled audit classes are copied.
Audit stream data can be displayed and processed as it is generated. For example, the command output
can be piped to an audit backend command for further processing or redirected to a file. Both the
auditselect command, which selects data records according to defined criteria, and the auditpr command,
which formats the records for viewing or for printing, are examples of backend commands.
The auditstream command can be called from the command line or be configured to run multiple times as
part of the audit system configuration. For information on configuring the auditstream command, refer to
″Setting up Auditing″ in Security and to the /etc/security/audit/config file.
Flags
-c Class Specifies the audit classes to be copied. Each class must be configured in the etc/security/audit/
config file as a list of comma-separated audit events. The default value is all the currently enabled
audit events.
-m Includes the CPU ID in each audit record.
Files Accessed:
Mode File
r /dev/audit
Examples
1. To configure the stream collection of audit data when the audit system is initialized, add the following
to the stream stanza of the /etc/security/audit/config file:
cmds = /etc/security/audit/streamcmds
Next, add to the /etc/security/audit/streamcmds file all the stream commands that should be
executed when the auditing system is initialized. For example:
/usr/sbin/auditstream -c authentication | \
/usr/sbin/auditpr -v > /dev/console
/usr/sbin/auditstream | /usr/sbin/auditselect -e \
"result == FAIL_ACCESS" | \
/usr/sbin/auditpr -t 2 -v > /dev/lpr2
The first command formats all records for events in the authentication class and writes them to the
system console. The second command formats all records that resulted in an access denial and prints
them on the printer /dev/lp2.
2. To record audit stream events on a line printer, enter:
/usr/sbin/auditstream | /usr/sbin/auditselect -e "event == \
USER_Login || event == USER_SU" | \
/usr/sbin/auditpr -v > /dev/lp0 &
This command formats and writes all user login and su events to the line printer.
Files
/usr/sbin/auditstream Specifies the path of the auditstream command.
/etc/rc Contains the system startup routines.
/dev/audit Specifies the audit device.
/etc/security/audit/config Contains audit system configuration information.
/etc/security/audit/events Contains the audit events of the system.
/etc/security/audit/objects Contains audit events for audited objects (files).
/etc/security/audit/bincmds Contains auditbin backend commands.
/etc/security/audit/streamcmds Contains auditstream commands.
/etc/security/audit/hosts Contains host and CPU IDs.
Related Information
The audit command, auditcat command, auditconv command, auditpr command, auditselect command.
For more information about the identification and authentication of users, discretionary access control, the
trusted computing base, and auditing, refer to Securing the network in Security.
To see the steps you must take to establish an Auditing System, refer to Setting up Auditing in Security.
autoconf6 Command
Purpose
Automatically configures IPv6 network interfaces at boot time.
Syntax
autoconf6 [ -a ] [ -A ] [ -i ] [ -s ] [ -6 ] [ -M ] [ -O ] [ -R ] [ -c ] [ -v ] [ -m main_interface ] [ interface_name
... ]
Description
The autoconf6 command is used at boot time to assign link-local addresses to ND-capable network
interfaces. The autoconf6 command initializes also the loopback interface, the automatic tunnels if
needed, and adds some needed routes. It can also be used at any time to set link-local addresses and
automatic tunnelling on newly configured ethernet-like interfaces.
Flags
-a Configures and turns up all acceptable interfaces that are already configured with
IPv4.
-A Configures and turns up all acceptable interfaces.
-i Configures and turns up the interfaces in the argument list. Without the -a and -i
flags only the interfaces already up are configured.
-m main_interface Specifies the main interface. You can also use the no command with the argument,
main_if6.
-s Installs the SIT interfaces and IPv4-compatible programs. Without this flag, the SIT
interfaces are configured only if an SIT interface is already up.
-6 The SIT interface and IPv4-compatible interoperability are not installed or modified.
-M (Debug) Do not modify existing IPv6 multicast routes.
-O (Debug) Do not configure the loopback interface.
-R (Debug) Do not install a default IPv6 route.
-c Old compatibility flag for those who have bad LL addresses.
-v Verbose output. The program displays what it is doing and/or what it is failing.
interface_name Specifies the names of the interfaces that should be configured. This is used with
the -i flag. If the -i flag is given and no interface_names are specified, no interfaces
are configured. If an interface_name is given and the -i flag is not specified, a
usage message is displayed.
Messages
Messages indicate the different actions done and/or problems encountered by autoconf6.
Related Information
The ifconfig command, ndpd-host command, ndpd-router command, and route command.
Purpose
Mounts automatic mount points.
Syntax
/usr/sbin/automount [ -m ] [ -n ] [ -v ] [ -t duration ] [ -i interval ] [ -f file ] [ -s timeout ] [
-D value ] [ -d value ]
Description
The automount command is used as an administration tool for AutoFS. It installs AutoFS mount points
and associates an automount map with each mount point. The AutoFS file system monitors attempts to
access directories within it and notifies the automountd daemon. The daemon uses the map to locate a
file system, which it then mounts at the point of reference within the AutoFS file system.
The previous automount behavior can be specified if the COMPAT_AUTOMOUNT environment variable is
set to any value before running the automount command. The current behavior became the default
behavior in AIX 5.0.
If the file system is not accessed within an appropriate interval (ten minutes by default), the automountd
daemon unmounts the file system.
If the automountd daemon has not been started the automount command attempts to start it using SRC.
Maps
Automount maps specify the mount points to be automatically mounted when accessed, and what should
be mounted over those mount points. The /etc/auto_master map file specifies the initial mount points,
known as keys, and their corresponding maps that determine which remote filesystem is mounted over it.
The format of the /etc/auto_master file is:
/key map
Note: The /etc/auto_master file is only read when the automount command is initially executed.
Changes to it will not take effect until the automount command is run again.
The most common maps are direct maps, indirect maps, and host maps.
Direct maps require a special key (/-) in the /etc/auto_master file, and their map is a file with the following
format:
/directkey [-options] server:/dir
When a user accesses the /directkey directory, the automountd daemon will mount server:/dir over
/directkey.
When a user accesses the /key/indirectkey directory, the automountd daemon will mount server:/dir
over /key/indirectkey.
Host maps require a special map (-hosts) in the /etc/auto_master file. The automountd daemon will
create a subdirectory under the /key directory for every server listed in the /etc/hosts file. When a user
accesses the /key/server directory, the automountd daemon will mount the server’s exported directories
over the /key/server directory.
It is possible to specify more than one name service, in the order that they will be used, by using a
whitespace separated list. For example, to indicate that LDAP maps should be used first, followed by local
files, the automount entry would be the following:
automount nis_ldap files
The valid values for the automount entry are files, nis, nisplus, and nis_ldap.
For more information on how to manage automount maps in NIS/NIS+, see Managing NIS Automount
Maps in AIX 5L Version 5.3 Network Information Services (NIS and NIS+) Guide.
For more information on how to manage automount maps in LDAP, see the Managing LDAP Automount
Maps section in PC-NFS in Networks and communication management.
Flags
-d value Specifies the debug level of the autofs extension and automount daemon.
-D value Specifies an environment variable and its value.
-f file Specifies a new master map file to use. The default is /etc/auto_master.
-i Interval Specifies the amount of time, in seconds, that an inactive autofs mounted directory
exists.
-m Specifies not to search NIS for automount maps.
-n Specifies the nobrowse option.
-s timeout Specifies the amount of time, in seconds, before a new process is forked off if a
mount takes too long. The minimum value is 30.
-t Duration Specifies the amount of time, in seconds, that the auto unmount process sleeps
before it starts to work again. The minimum value is 21. The default value is 120.
The maximum value is 600.
-v Displays on standard output verbose status and warning messages.
Files
/etc/auto_master The default map file used to create the initial automount keys.
/etc/hosts Specifies servers that will be used in automount host maps.
/etc/[Link] Specifies the location of the automount maps.
Related Information
The mount command.
Managing NIS Automount Maps in AIX 5L Version 5.3 Network Information Services (NIS and NIS+) Guide
discusses map formatting, multiple mounts, special maps, and the [Link] NIS configuration map file.
Managing LDAP Automount Maps section in PC-NFS in Networks and communication management
Network File System (NFS) Overview for System Management in Networks and communication
management.
Purpose
AutoFS mount and unmount daemon.
Syntax
/usr/sbin/automountd [ -n ] [ -T ] [ -v ] [ -D name=value ]
Description
The automountd daemon is an RPC server that processes and answers requests from the local AutoFS
filesystem kernel extension. It uses local files or name service maps to locate file systems to be mounted.
Maps
For a description on map files see the information on Maps in the automount daemon.
Flags
-Dname=Value Assigns a value to the indicated automountd daemon environment variable.
-n Sets the nobrowse option on all maps by default.
-T Traces RPC server calls, displaying it on standard output.
-v Displays on standard output verbose status and warning messages.
Related Information
The df command, mount command, automount daemon.
How to Manage NIS automount Maps in AIX 5L Version 5.3 Network Information Services (NIS and NIS+)
Guide discusses map formatting, multiple mounts, special maps, and the auto_master/[Link] NIS
configuration map file.
Network File System (NFS) Overview for System Management in Networks and communication
management.
autopush Command
Purpose
Configures lists of automatically pushed STREAMS modules.
Syntax
autopush -f File
Description
The autopush command configures the list of modules to be automatically pushed onto the stream when
a device is opened. It can also remove a previous setting or obtain information on a setting.
The file specified by the File parameter consists of lines consisting of at least four fields per line.
Each field is separated by a character space as shown in the following example:
maj_ min_ last_min_ mod1 mod2 . . . modn
The first three fields are integers that specify the major device number, minor device number, and
last minor device number. The subsequent fields represent the names of modules. If the value of the
min_ field is -1, then all minor devices of a major driver specified by the maj_ field are configured and
the value of the last_min_ field is ignored. If the value of the last_min_ field is 0, then only a single
minor device is configured. To configure a range of minor devices for a particular major, the value of
the min_ field must be less than the value of the last_min_ field.
The last fields of a line in the autopush file represent the list of module names. Each module name
is separated by a character space. The maximum number of modules that can be automatically
pushed on a stream is eight, and they are pushed onto the stream in the order they are listed.
Comment lines start with a # (pound sign).
-r Removes the previous configuration setting of a particular major and minor device number.
-g Obtains the current configuration setting of a particular major and minor device number. It also
returns the starting minor device number if the request corresponds to a setting of a range.
-M Major Specifies a major device number.
-m Minor Specifies a minor device number.
This operating system provides an enhancement to the autopush command that makes it easier to
specify major numbers. The name of a driver can be specified instead of its major number anywhere the
major number is normally used.
Parameters
File Contains at least the major device number, minor device number, last minor device number and modules.
Major Specifies a major device number.
Minor Specifies a minor device number.
Examples
1. To configure a list of automatically pushed Streams modules, type:
autopush -f File
2. To remove the previous configuration, type:
autopush -r -M Major -m Minor
3. To show the current configuration, type:
autopush -g -M Major -m Minor
Related Information
The streamio operations.
Purpose
Finds lines in files that match a pattern and performs specified actions on those lines.
Syntax
awk [ -F Ere ] [ -v Assignment ] ... { -f ProgramFile | ’Program’ } [ [ File ... | Assignment ... ] ] ...
Description
The awk command utilizes a set of user-supplied instructions to compare a set of files, one line at a time,
to extended regular expressions supplied by the user. Then actions are performed upon any line that
matches the extended regular expressions.
The pattern searching of the awk command is more general than that of the grep command, and it allows
the user to perform multiple actions on input text lines. The awk command programming language
requires no compiling, and allows the user to use variables, numeric functions, string functions, and logical
operators.
The awk command is affected by the LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES,
LC_NUMERIC, NLSPATH, and PATH environment variables.
If multiple files are specified with the File variable, the files are processed in the order specified.
Program Instructions
Instructions provided by the user control the actions of the awk command. These instructions come from
either the `Program’ variable on the command line or from a file specified by the -f flag together with the
ProgramFile variable. If multiple program files are specified, the files are concatenated in the order
specified and the resultant order of instructions is used.
All of these types of output can be performed on the same file. The programming language recognized by
the awk command allows the user to redirect output.
Pattern { Action }
If a record matches the specified pattern, or contains a field which matches the pattern, the associated
action is then performed. A pattern can be specified without an action, in which case the entire line
containing the pattern is written to standard output. An action specified without a pattern is performed for
every input record.
Regular Expressions
The extended regular expressions used by the awk command are similar to those used by the grep or
egrep command. The simplest form of an extended regular expression is a string of characters enclosed
in slashes. For an example, suppose a file named testfile had the following contents:
smawley, andy
smiley, allen
smith, alan
smithern, harry
smithhern, anne
smitters, alexis
would print to standard output of all records that contained an occurrence of the string smi. In this
example, the program ’/smi/’ for the awk command is a pattern with no action. The output is:
smiley, allen
smith, alan
smithern, harry
smithhern, anne
smitters, alexis
The following special characters are used to form extended regular expressions:
Character Function
+ Specifies that a string matches if one or more occurrences of the character or extended
regular expression that precedes the + (plus) are within the string. The command line:
awk ’/smith+ern/’ testfile
prints to standard output any record that contained a string with the characters smit,
followed by one or more h characters, and then ending with the characters ern. The output
in this example is:
smithern, harry
smithhern, anne
? Specifies that a string matches if zero or one occurrences of the character or extended
regular expression that precedes the ? (question mark) are within the string. The command
line:
awk ’/smith?/’ testfile
prints to standard output of all records that contain the characters smit, followed by zero or
one instance of the h character. The output in this example is:
smith, alan
smithern, harry
smithhern, anne
smitters, alexis
prints to standard output of all records that contained the string allen or alan. The output in
this example is:
smiley, allen
smith, alan
() Groups strings together in regular expressions. The command line:
awk ’/a(ll)?(nn)?e/’ testfile
prints to standard output of all records with the string ae or alle or anne or allnne. The
output in this example is:
smiley, allen
smithhern, anne
{m} Specifies that a string matches if exactly m occurrences of the pattern are within the string.
The command line:
awk ’/l{2}/’ testfile
prints to standard output of all records with the characters sm followed by any character in
alphabetical order from a to h. The output in this example is:
smawley, andy
[^ String] A ^ (caret) within the [ ] (square brackets) and at the beginning of the specified string
indicates that the regular expression does not match any characters within the square
brackets. Thus, the command line:
awk ’/sm[^a-h]/’ testfile
prints to standard output of all records whose first field contained the character n. The
output in this example is:
smithern, harry
smithhern, anne
^ Signifies the beginning of a field or record. The command line:
awk ’$2 ~ /^h/’ testfile
prints to standard output of all records with the character h as the first character of the
second field. The output in this example is:
smithern, harry
$ Signifies the end of a field or record. The command line:
awk ’$2 ~ /y$/’ testfile
prints to standard output of all records with the character y as the last character of the
second field. The output in this example is:
smawley, andy
smithern, harry
. (period) Signifies any one character except the terminal new-line character at the end of a space.
The command line:
awk ’/a..e/’ testfile
prints to standard output of all records with the characters a and e separated by two
characters. The output in this example is:
smawley, andy
smiley, allen
smithhern, anne
*(asterisk) Signifies zero or more of any characters. The command line:
awk ’/a.*e/’ testfile
prints to standard output of all records with the characters a and e separated by zero or
more characters. The output in this example is:
smawley, andy
smiley, allen
smithhern, anne
smitters, alexis
\ (backslash) The escape character. When preceding any of the characters that have special meaning in
extended regular expressions, the escape character removes any special meaning for the
character. For example, the command line:
/a\/\//
would match the pattern a //, since the backslashes negate the usual meaning of the slash
as a delimiter of the regular expression. To specify the backslash itself as a character, use
a double backslash. See the following item on escape sequences for more information on
the backslash and its uses.
Recognized Escape Sequences: The awk command recognizes most of the escape sequences used in
C language conventions, as well as several that are used as special characters by the awk command
itself. The escape sequences are:
Note: Except in the gsub, match, split, and sub built-in functions, the matching of extended regular
expressions is based on input records. Record-separator characters (the new-line character by
default) cannot be embedded in the expression, and no expression matches the record-separator
character. If the record separator is not the new-line character, then the new-line character can be
matched. In the four built-in functions specified, matching is based on text strings, and any character
(including the record separator) can be embedded in the pattern so that the pattern matches the
appropriate character. However, in all regular-expression matching with the awk command, the use
of one or more NULL characters in the pattern produces undefined results.
Relational Expressions
The relational operators < (less than), > (greater than), <= (less than or equal to), >= (greater than or
equal to), = = (equal to), and ! = (not equal to) can be used to form patterns. For example, the pattern:
$1 < $4
matches records where the first field is less than the fourth field. The relational operators also work with
string values. For example:
$1 =! "q"
matches all records where the first field is not a q. String values can also be matched on collation values.
For example:
$1 >= "d"
matches all records where the first field starts with a character that is a, b, c, or d. If no other information is
given, field variables are compared as string values.
Combinations of Patterns
Patterns can be combined using three options:
v Ranges are specified by two patterns separated with a , (comma). Actions are performed on every
record starting with the record that matches the first pattern, and continuing through and including the
record that matches the second pattern. For example:
/begin/,/end/
matches the record containing the string begin, and every record between it and the record containing
the string end, including the record containing the string end.
v Parentheses ( ) group patterns together.
v The boolean operators || (or), && (and), and ! (not) combine patterns into expressions that match if they
evaluate true, otherwise they do not match. For example, the pattern:
$1 == "al" && $2 == "123"
matches records where the first field is al and the second field is 123.
Actions
There are several types of action statements:
v Action Statements
v Built-in Functions
v User-Defined Functions
v Conditional Statements
v Output Actions
Action Statements
Action statements are enclosed in { } (braces). If the statements are specified without a pattern, they are
performed on every record. Multiple actions can be specified within the braces, but must be separated by
new-line characters or ; (semicolons), and the statements are processed in the order they appear. Action
statements include:
Arithmetical Statements
The mathematical operators + (plus), - (minus), / (division), ^ (exponentiation), * (multiplication), % (modulus) are used
in the form:
Expression Operator Expression
assigns the value of the first field raised to the third power to the second field.
Unary Statements
The unary - (minus) and unary + (plus) operate as in the C programming language:
+Expression or -Expression
Assignment Statements
multiplies the field variable $1 by the field variable $2 and then assigns the new value to $1.
AND
Variable2%=Expression2
AND
Variable2=fmod(Variable2, Expression2)
where pow is the pow subroutine and fmod is the fmod subroutine.
assigns the concatenation of the strings in the field variables $1 and $2 to the field variable $3.
Built-In Functions
The awk command language uses arithmetic functions, string functions, and general functions. The close
Subroutine statement is necessary if you intend to write a file, then read it later in the same program.
Arithmetic Functions: The following arithmetic functions perform the same actions as the C language
subroutines by the same name:
Note: All forms of the getline function return 1 for successful input, zero for end of file, and -1 for an
error.
User-Defined Functions
User-defined functions are declared in the following form:
function Name (Parameter, Parameter,...) { Statements }
A function can be referred to anywhere in an awk command program, and its use can precede its
definition. The scope of the function is global.
Function parameters can be either scalars or arrays. Parameter names are local to the function; all other
variable names are global. The same name should not be used for different entities; for example, a
parameter name should not be duplicated as a function name, or special variable. Variables with global
scope should not share the name of a function. Scalars and arrays should not have the same name in the
same scope.
The number of parameters in the function definition does not have to match the number of parameters
used when the function is called. Excess formal parameters can be used as local variables. Extra scalar
parameters are initialized with a string value equivalent to the empty string and a numeric value of 0
(zero); extra array parameters are initialized as empty arrays.
When invoking a function, no white space is placed between the function name and the opening
parenthesis. Function calls can be nested and recursive. Upon return from any nested or recursive
function call, the values of all the calling function’s parameters shall be unchanged, except for array
parameters passed by reference. The return statement can be used to return a value.
Within a function definition, the new-line characters are optional before the opening { (brace) and after the
closing } (brace).
The function average is passed an array, g, and a variable, n, with the number of elements in the array.
The function then obtains an average and returns it.
Conditional Statements
Most conditional statements in the awk command programming language have the same syntax and
function as conditional statements in the C programming language. All of the conditional statements allow
the use of { } (braces) to group together statements. An optional new-line can be used between the
expression portion and the statement portion of the conditional statement, and new-lines or ; (semicolon)
are used to separate multiple statements in { } (braces). Six conditional statements in C language are:
Five conditional statements in the awk command programming language that do not follow C-language
rules are:
The for...in statement sets the Variable parameter to each index value of the Array variable, one
index at a time and in no particular order, and performs the action specified by the Statement
parameter with each iteration. See the delete statement for an example of a for...in statement.
if...in Requires the following syntax:
The if...in statement searches for the existence of the Array element. The statement is performed if
the Array element is found.
delete Requires the following syntax:
The delete statement deletes both the array element specified by the Array parameter and the index
specified by the Expression parameter. For example, the statements:
for (i in g)
delete g[i];
exit [ Expression ]
The exit statement first invokes all END actions in the order they occur, then terminates the awk
command with an exit status specified by the Expression parameter. No subsequent END actions are
invoked if the exit statement occurs within an END action.
# Requires the following syntax:
# Comment
The # statement places comments. Comments should always end with a new-line but can begin
anywhere on a line.
next Stops the processing of the current input record and proceeds with the next input record.
The print statement writes the value of each expression specified by the ExpressionList parameter to
standard output. Each expression is separated by the current value of the OFS special variable, and
each record is terminated by the current value of the ORS special variable.
The output can be redirected using the Redirection parameter, which can specify the three output
redirections with the > (greater than), >> (double greater than), and the | (pipe). The Redirection
parameter specifies how the output is redirected, and the Expression parameter is either a path name to
a file (when Redirection parameter is > or >> ) or the name of a command ( when the Redirection
parameter is a | ).
printf Requires the following syntax:
The printf statement writes to standard output the expressions specified by the ExpressionList parameter
in the format specified by the Format parameter. The printf statement functions exactly like the printf
command, except for the c conversion specification (%c). The Redirection and Expression parameters
function the same as in the print statement.
For the c conversion specification: if the argument has a numeric value, the character whose encoding is
that value will be output. If the value is zero or is not the encoding of any character in the character set,
the behavior is undefined. If the argument does not have a numeric value, the first character of the string
value will be output; if the string does not contain any characters the behavior is undefined.
Note: If the Expression parameter specifies a path name for the Redirection parameter, the
Expression parameter should be enclosed in double quotes to insure that it is treated as a string.
Variables
Variables can be scalars, field variables, arrays, or special variables. Variable names cannot begin with a
digit.
Variables can be used just by referencing them. With the exception of function parameters, they are not
explicitly declared. Uninitialized scalar variables and array elements have both a numeric value of 0 (zero)
and a string value of the null string (″ ″).
Variables take on numeric or string values according to context. Each variable can have a numeric value,
a string value, or both. For example:
x = "4" + "8"
assigns the value of 12 to the variable x. For string constants, expressions should be enclosed in ″ ″
(double quotation) marks.
There are no explicit conversions between numbers and strings. To force an expression to be treated as a
number, add 0 (zero) to it. To force an expression to be treated as a string, append a null string (″ ″).
Field Variables
Field variables are designated by a $ (dollar sign) followed by a number or numerical expression. The first
field in a record is assigned the $1 variable , the second field is assigned to the $2 variable, and so forth.
The $0 field variable is assigned to the entire record. New field variables can be created by assigning a
value to them. Assigning a value to a non-existent field, that is, any field larger than the current value of
$NF field variable, forces the creation of any intervening fields (set to the null string), increases the value
of the NF special variable, and forces the value of $0 record variable to be recalculated. The new fields
Arrays
Arrays are initially empty and their sizes change dynamically. Arrays are represented by a variable with
subscripts in [ ] (square brackets). The subscripts, or element identifiers, can be numbers of strings, which
provide a type of associative array capability. For example, the program:
/red/ { x["red"]++ }
/green/ { y["green"]++ }
increments counts for both the red counter and the green counter.
Arrays can be indexed with more than one subscript, similar to multidimensional arrays in some
programming languages. Because programming arrays for the awk command are really one dimensional,
the comma-separated subscripts are converted to a single string by concatenating the string values of the
separate expressions, with each expression separated by the value of the SUBSEP environmental
variable. Therefore, the following two index operations are equivalent:
x[expr1, expr2,...exprn]
AND
x[expr1SUBSEPexpr2SUBSEP...SUBSEPexprn]
When using the in operator, a multidimensional Index value should be contained within parentheses.
Except for the in operator, any reference to a nonexistent array element automatically creates that
element.
Special Variables
The following variables have special meaning for the awk command:
ARGC The number of elements in the ARGV array. This value can be altered.
ARGV The array with each member containing one of the File variables or Assignment variables, taken in
order from the command line, and numbered from 0 (zero) to ARGC -1. As each input file is finished,
the next member of the ARGV array provides the name of the next input file, unless:
v The next member is an Assignment statement, in which case the assignment is evaluated.
v The next member has a null value, in which case the member is skipped. Programs can skip
selected input files by setting the member of the ARGV array that contains that input file to a null
value.
v The next member is the current value of ARGV [ARGC -1], which the awk command interprets as
the end of the input files.
CONVFMT The printf format for converting numbers to strings (except for output statements, where the OFMT
special variable is used). The default is ″%.6g″.
ENVIRON An array representing the environment under which the awk command operates. Each element of the
array is of the form:
The values are set when the awk command begins execution, and that environment is used until the
end of execution, regardless of any modification of the ENVIRON special variable.
FILENAME The path name of the current input file. During the execution of a BEGIN action, the value of
FILENAME is undefined. During the execution of an END action, the value is the name of the last
input file processed.
FNR The number of the current input record in the current file.
Flags
-f ProgramFile Obtains instructions for the awk command from the file specified by the ProgramFile
variable. If the -f flag is specified multiple times, the concatenation of the files, in the
order specified, will be used as the set of instructions.
-F Ere Uses the extended regular expression specified by the Ere variable as the field separator.
The default field separator is a blank.
-v Assignment Assigns a value to a variable for the awk command’s programming language. The
Assignment parameter is in the form of Name = Value. The Name portion specifies the
name of the variable and can be any combination of underscores, digits, and alphabetic
characters, but it must start with either an alphabetic character or an underscore. The
Value portion is also composed of underscores, digits, and alphabetic characters, and is
treated as if it were preceded and followed by a ″ (double-quotation character, similar to a
string value). If the Value portion is numeric, the variable will also be assigned the
numeric value.
The assignment specified by the -v flag occurs before any portion of the awk command’s
program is executed, including the BEGIN section.
Assignment Assigns a value to a variable for the awk command’s programming language. It has the
same form and function as the Assignment variable with the -v flag, except for the time
each is processed. The Assignment parameter is processed just prior to the input file
(specified by the File variable) that follows it on the command line. If the Assignment
parameter is specified just prior to the first of multiple input files, the assignments are
processed just after the BEGIN sections (if any). If an Assignment parameter occurs after
the last file, the assignment is processed before the END sections (if any). If no input files
are specified, the assignments are processed the standard input is read.
File Specifies the name of the file that contains the input for processing. If no File variable is
specified, or if a - (minus) sign is specified, standard input is processed.
’Program’ Contains the instructions for the awk command. If the -f flag is not specified, the Program
variable should be the first item on the command line. It should be bracketed by ’ ’ (single
quotes).
0 Successful completion.
>0 An error occurred.
You can alter the exit status within the program by using the exit [ Expression ] conditional statement.
Examples
1. To display the lines of a file that are longer than 72 characters, enter:
awk ’length >72’ chapter1
This selects each line of the chapter1 file that is longer than 72 characters and writes these lines to
standard output, because no Action is specified. A tab character is counted as 1 byte.
2. To display all lines between the words start and stop, including ″start″ and ″stop″, enter:
awk ’/start/,/stop/’ chapter1
3. To run an awk command program, [Link], that processes the file, chapter1, enter:
awk -f [Link] chapter1
The following program, [Link], computes the sum and average of the numbers in the second
column of the input file, chapter1:
{
sum += $2
}
END {
print "Sum: ", sum;
print "Average:", sum/NR;
}
The first action adds the value of the second field of each line to the variable sum. All variables are
initialized to the numeric value of 0 (zero) when first referenced. The pattern END before the second
action causes those actions to be performed after all of the input file has been read. The NR special
variable, which is used to calculate the average, is a special variable specifying the number of records
that have been read.
4. To print the first two fields in opposite order, enter:
awk ’{ print $2, $1 }’ chapter1
5. The following awk program
awk -f [Link] chapter2
prints the first two fields of the file chapter2 with input fields separated by comma and/or blanks and
tabs, and then adds up the first column, and prints the sum and average:
BEGIN {FS = ",|[ \t]+"}
{print $1, $2}
{s += $1}
END {print "sum is",s,"average is", s/NR }
Related Information
The egrep command, fgrep command, grep command, lex command, printf command, sed command.
Purpose
Starts the backgammon game.
Syntax
back
Description
The back command provides you with a partner for backgammon. You select one of the following three
skill levels: beginner, intermediate, or expert. You can choose to roll your own dice during your turns, and
you are asked if you want to move first.
For details on how to make your moves, enter Y when prompted for Instructions? at the beginning of the
game. During play, you are prompted for move?. Either enter a numerical move or press ? (question mark)
key for a list of move choices.
When the game is finished, you are asked if you want to save game information. Entering Y stores game
data in the [Link] file in your current directory.
The back command plays only the forward game, even at the expert level. It objects if you try to make too
many moves in a turn, but not if you make too few. Doubling is not permitted.
Files
/usr/games Location of the system’s games.
/usr/games/lib/backrules Location of the rules file.
/tmp/b* Location of the log temp file.
[Link] Contains data from previously played games.
Related Information
The arithmetic command, bj command, craps command, fish command, fortune command, hangman
command, moo command, number command, quiz command, ttt command, turnoff command, turnon
command, wump command.
backsnap Command
Purpose
Provides an interface to create a snapshot for a JFS2 file system and perform a backup of the snapshot.
Syntax
backsnap [ -R ] -m MountPoint -s size=Size [ BackupOptions ] FileSystem
Flags
-m MountPoint Specifies the path of where the snapshot created should
be mounted.
-R Specifies that the snapshot created by this command will
be removed when the backup completes.
-s size=Size Specifies the size to create the new logical volume.
Parameters
BackupOptions Any other options are passed to the backup command
when the backup of the snapshot is performed. Minimally,
it is required to specify the type of backup desired.
Exit Status
0 The command completed successfully.
>0 An error occurred.
Examples
1. To create a snapshot for the /home/janet/sb file system and perform a backup on the snapshot by
name, enter:
backsnap -m /tmp/snapshot/janetsb -s size=16M -i -f/dev/rmt0 /home/janet/sb
This command creates a logical volume of size 16 megabytes and then creates a snapshot for the
/home/janet/sb file system on the newly created logical volume. It then mounts the snapshot on
/tmp/snapshot/janetsb and backs up the files and directories in that file system by name to the
/dev/rmt0 device.
2. To create a snapshot for the /home/janet/sb file system and perform a backup on the snapshot by
inode, enter:
backsnap -R -m /tmp/snapshot/janetsb -s size=16M -0 -f /dev/rmt0 /home/janet/sb
Files
/usr/sbin/backsnap Contains the backsnap command.
Related Information
The backup command, restore command, snapshot command.
backup Command
Purpose
Backs up files and file systems.
Syntax
To Back Up Files by Name
backup -i [ -b Number ] [ -p [ -e RegularExpression ] ] [ -E{force|ignore|warn} ] [ -f Device ] [ -l Number ]
[ -U ] [ -o ] [ -q ] [ -v ]
Description
The backup command creates copies of your files on a backup medium, such as a magnetic tape or
diskette. The copies are in one of the two backup formats:
v Specific files backed up by name using the -i flag.
v Entire file system backed up by i-node using the Level and FileSystem parameters.
If you issue the backup command without any parameters, it defaults to a level 9 i-node backup of the
root file system to the /dev/rfd0 device. The default syntax is:
-9uf/dev/rfd0 /dev/rhd4
The default backup device is /dev/rfd0. If flags are specified that are not appropriate for the specified
backup device, the backup command displays an error message and continues with the backup.
Notes:
1. Running the backup command results in the loss of all material previously stored on the selected
output medium.
2. Data integrity of the archive may be compromised if a file is modified during system backup.
Keep system activity at a minimum during the system backup procedure.
3. If a backup is made to a tape device with the device block size set to 0, it might be difficult to
restore data from the tape unless the default write size was used with the backup command. The
default write size for the backup command can be read by the restore command when the tape
device block size is 0.
File types can be special files, regular files, or directories. When the file type is a directory, only the
directory is backed up. The files under the directory are not backed up, unless they are explicitly specified.
Notes:
1. Files are restored using the same path names as the archived files. Therefore, to create a
backup that can be restored from any path, use full path names for the files that you want to
back up.
2. When backing up files that require multiple volumes, do not enter the list of file names from the
keyboard. Instead, pipe or redirect the list from a file to the backup command.
When you enter the file names from the keyboard and the backup process needs a new tape or
diskette, the command ″loses″ any file names already entered but not yet backed up. To avoid
this problem, enter each file name only after the archived message for the previous file has been
displayed. The archived message consists of the character a followed by the file name.
3. If you specify the -p flag, only files of less than 2GB are packed.
The FileSystem parameter can specify either the physical device name (block or raw name) or the name
of the directory on which the file system is mounted. The default file system is the root (/) file system.
Users must have read access to the file system device (such as /dev/hd4) or have Backup authorization
in order to perform backups by i_node.
Notes:
1. You must first unmount a file system before backing it up by i-node. If you attempt to back up a
mounted file system, a warning message is displayed. The backup command continues, but the
created backup may contain inconsistencies because of changes that may have occurred in the
file system during the backup operation.
2. Backing up file systems by i-node truncates the uid or gid of files having a uid or gid greater
than 65535. When restored, these files may have different values for the uid and gid attributes.
To retain the values correctly, always back up by name files having a uid or gid greater than
65535.
3. You can archive only JFS (Journaled File System) file systems when backing up by i-node. Back
up any non-JFS file systems by file name or by using other archive commands, such as the pax,
tar, or cpio command.
The write size is the number of blocks multiplied by the block size. The
default write size for the backup command writing to tape devices is 51200
(100 * 512) for backups by name and 32768 (32 * 1024) for backups by
i-node. The write size must be an even multiple of the tape’s physical block
size.
The value of the -b flag is always ignored when the backup command writes
to diskette. In this case, the command always writes in clusters that occupy a
complete track.
-c Specifies that the tape is a cartridge, not a nine-track.
-e RegularExpression Specifies that the files with names matching the regular expression are not to
be packed. A regular expression is a set of characters, meta characters, and
operators that define a string or group of strings in a search pattern. It can
also be a string containing wildcard characters and operations that define a
set of one or more possible strings. The -e flag is applied only when the -p
flag is specified.
-E For backups by name, the -E option requires one of the following arguments.
If you omit the -E option, warn is the default behavior.
force Fails the backup operation on a file if the fixed extent size or space
reservation of the file cannot be preserved.
ignore Ignores any errors in preserving extent attributes.
warn Issues a warning if the space reservation or the fixed extent size of
the file cannot be preserved.
-f Device Specifies the output device. To send output to a named device, specify the
Device variable as a path name (such as /dev/rmt0). To send output to the
standard output device, specify a - (minus sign). The - (minus) feature
enables you to pipe the output of the backup command to the dd command.
You can also specify a range of archive devices. The range specification must
be in the following format:
/dev/deviceXXX-YYY
where XXX and YYY are whole numbers, and XXX must always be less than
YYY; for example, /dev/rfd0-3.
All devices in the specified range must be of the same type. For example, you
can use a set of 8mm, 2.3GB tapes or a set of 1.44MB diskettes. All tape
devices must be set to the same physical tape block size.
Files with attributes and values, such as user IDs and group IDs, that are too
large for Version 2 systems will not be backed up. A message is displayed for
each such file and each value that is too large.
-p Specifies that the files be packed, or compressed, before they are archived.
Only files of less than 2GB are packed.
Note: This option should only be used when backing up files from an
inactive filesystem. Modifying a file when a backup is in progress may
result in corruption of the backup and an inability to recover the data.
When backing up to a tape device which performs compression, this
option can be omitted.
-q Indicates that the removable medium is ready to use. When you specify the
-q flag, the backup command proceeds without prompting you to prepare the
backup medium and press the Enter key to continue. This option applies only
to the first volume; you are prompted for subsequent volumes. The -q flag
applies only to backups by name.
-U Specifies to backup any ACLs or named extended attributes. Without this
option the image will include only AIXC ACLs and PCLs in the archive along
with the other regular file data. For files containing NFS4 ACLs, conversion to
AIXC will happen by default during archival.
-u Updates the /etc/dumpdates file with the raw device name of the file system
and the time, date, and level of the backup. You must specify the -u flag if
you are making incremental backups. The -u flag applies only to backups by
i-node.
-v Causes the backup command to display additional information about the
backup. When using the -v flag, the size of the file as it exists on the archive
is displayed in bytes. Additionally, a total of these file sizes is displayed when
all files have been processed. Directories are listed with a size of 0. Symbolic
links are listed with the size of the symbolic link. Hard links are listed with the
size of the file, which is how hard links are archived. Block and character
devices, if they were backed up, are listed with a size of 0.
When the -v flag is not specified, the backup command displays only the
names of the files being archived. This option is used only when backing up
by file name.
-w Currently disabled. If the -w flag is specified, no other flags are applied.
-W Displays, for each file system in the /etc/dumpdates file, the most recent
backup date and level. If the -W option is specified, no other flags are
applied.
-Level Specifies the backup level (0 to 9). The default level is 9.
0 Successful completion.
>0 An error occurred.
Examples
1. To backup all the files and subdirectories in the /home directory using full path names, enter:
The -i flag specifies that files will be read from standard input and archived by file name. The find
command generates a list of all the files in the /home directory. The files in this list are full path names.
The | (pipe symbol) causes this list to be read from standard input by the backup command. The -f
flag directs the backup command to write the files to the /dev/rmt0 tape device. Because the files are
archived using full path names, they will be written to the same paths when restored.
2. To backup all the files and subdirectories in the /home/mike directory using relative path names, enter:
cd /home
find . -print | backup -i -v -q
Each file name in the list generated by the find command is preceded by ./ (dot, slash). Because the
files are backed up using relative path names, they will be written to the current directory when
restored. The -v flag causes the backup command to display additional information about the backup.
The files are written to the default backup device /dev/rfd0.
3. To backup the / (root) file system, enter:
backup -0 -u -f /dev/rmt0 /
The 0 level specifies that all the files in the / (root) file system be backed up. The -u flag causes the
backup command to update the /etc/dumpdates file for this backup.
4. To backup all the files in the / (root) file system that have been modified since the last level 0 backup,
enter:
backup -1 -u -f /dev/rmt0 /
If the /etc/dumpdates file does not have an entry for a level 0 backup of the / (root) system, all the
files in the file system are backed up.
5. To create an archive with Extended Attributes and ACLs, enter:
ls /etc/passwd | backup -ivUf [Link]
Files
/etc/filesystems Contains file system mount information.
/etc/dumpdates Specifies log for incremental by i-node backups.
/dev/rfd0 Specifies default backup device.
/dev/rhd4 Specifies device where the default file system (root) is located.
/usr/sbin/backup Contains the backup command.
The System backup in Operating system and device management provides information on different
methods of backing up, restoring process, different types of backup media, and guidelines for backup
policies.
The Directories in Operating system and device management explains working with directories and path
names.
The File systems in Operating system and device management explains file system types, management,
structure, and maintenance.
The Mounting in Operating system and device management explains mounting files and directories, mount
points, and automatic mounts.
The System management interface tool in Operating system and device management explains the
structure, main menus, and tasks that are done with SMIT.
banner Command
Purpose
Writes ASCII character strings in large letters to standard output.
Syntax
banner String
Description
The banner command writes ASCII character Strings to standard output in large letters. Each line in the
output can be up to 10 uppercase or lowercase characters in length. On output, all characters appear in
uppercase, with the lowercase input characters appearing smaller than the uppercase input characters.
Each word you input appears on a separate line on the screen. When you want to display more than one
word to a line, use quotation marks to specify which words will appear on one line.
Examples
1. To display a banner at the workstation, enter:
banner SMILE!
2. To display more than one word on a line, enclose the text in quotation marks, as follows:
banner "Out to" Lunch
Files
/usr/bin/banner Contains the banner command.
Related Information
The echo command.
basename Command
Purpose
Returns the base file name of a string parameter.
Syntax
basename String [ Suffix ]
Description
The basename command reads the String parameter, deletes any prefix that ends with a / (slash) and any
specified Suffix parameter, and writes the remaining base file name to standard output. The basename
command applies the following rules in creating the base file name:
1. If the String parameter is a // (double slash), or if the String parameter consists entirely of slash
characters, change the string to a single / (slash). Skip steps 2 through 4.
2. Remove any trailing / characters from the specified string.
3. If there are any / characters remaining in the String parameter, remove the prefix of the string up to
and including the last / character.
4. If a Suffix parameter is specified and is identical to the characters remaining in the string, the string is
not modified. For example, entering:
K > basename /u/dee/desktop/[Link] [Link]
results in:
[Link]
If a Suffix parameter is specified and is not identical to all the characters in the string but is identical to
a suffix in the string, the specified suffix is removed. For example, entering:
K > basename /u/dee/desktop/[Link] .boo
results in:
cns
Failure to find the specified suffix within a string is not considered an error.
The basename and dirname commands are generally used inside command substitutions within a shell
script to specify an output file name that is some variation of a specified input file name.
Exit Status
This command returns the following exit values:
0 Successful completion.
>0 An error occurred.
Examples
1. To display the base name of a shell variable, enter:
basename $WORKFILE
This command assigns to the OFILE file the value of the first positional parameter ($1), but with its .c
suffix changed to .o. If $1 is the /home/jim/program.c file, OFILE becomes program.o. Because
program.o is only a base file name, it identifies a file in the current directory.
Files
/usr/bin/basename Contains the basename command.
Related Information
The dirname command, sh command.
batch Command
Purpose
Runs jobs when the system load level permits.
Syntax
batch
Description
The batch command reads from standard input the names of commands to be run at a later time and runs
the jobs when the system load level permits. The batch command mails you all output from standard
output and standard error for the scheduled commands, unless you redirect that output. It also writes the
job number and the scheduled time to standard error.
When the batch command is executed, it retains variables in the shell environment, and the current
directory; however, it does not retain open file descriptors, traps, and priority.
The batch command is equivalent to entering the at -q b -m now command. The -q b flag specifies the at
queue for batch jobs.
Exit Status
This command returns the following exit values:
0 Successful completion
>0 An error occurred.
Examples
To run a job when the system load permits, enter:
batch <<!
longjob
!
This example shows the use of a ″Here Document″ to send standard input to the batch command.
Alphabetical Listing of Commands 197
Files
/usr/bin/batch Contains the batch command.
/bin/batch Symbolic link to the batch command.
/var/adm/cron Indicates the main cron daemon directory.
/var/spool/cron/atjobs Indicates the spool area.
Related Information
at command, bsh command, csh command, kill command, ksh command, mail command, nice
command, ps command.
Daemons: cron.
Input and output redirection overview in Operating system and device management describes how the
operating system processes input and output.
Korn shell or POSIX shell built-in commands and Bourne shell built-in commands in Operating system and
device management.
National Language Support Overview for Programming in AIX 5L Version 5.3 General Programming
Concepts: Writing and Debugging Programs explains collating sequences, equivalence classes, and
locale.
Shells in Operating system and device management describes what shells are, the different types of
shells, and how shells affect the way commands are interpreted.
battery Command
Purpose
Controls or queries battery information.
Syntax
battery [ -d ]
Description
The battery command controls or queries the battery. If the battery command is invoked without -d
option, the following battery information is displayed:
battery type: NiCd or NiMH
current battery usage: charging, discharging, in use, fully charged
battery capacity
current remaining capacity
full charge count
If the battery command is invoked with -d option, the following battery information is also displayed:
discharge quantity
discharge time
If you use 50% of a battery’s capacity and charge it every time (about 20 to 30 times), then the battery
cannot be used at more than 50% of its capacity. This is called the memory effect of battery. If, then, the
battery is discharged (made empty) and then recharged, the battery can be used at 100% again.
Security
Access Control: Any User
Examples
1. To show current battery status, enter:
battery
Files
/usr/bin/battery Contains the battery command.
bc Command
Purpose
Provides an interpreter for arbitrary-precision arithmetic language.
Syntax
bc [ -c ] [ -l ] [ File ... ]
Description
The bc command is an interactive process that provides arbitrary-precision arithmetic. The bc command
first reads any input files specified by the File parameter and then reads the standard input. The input files
must be text files containing a sequence of commands, statements, or function definitions that the bc
command can read and execute.
The bc command is a preprocessor for the dc command. It calls the dc command automatically, unless
the -c (compile only) flag is specified. If the -c flag is specified, the output from the bc command goes to
standard output.
The bc command allows you to specify an input and output base for operations in decimal, octal, or
hexadecimal. The default is decimal. The command also has a scaling provision for decimal point notation.
The bc command always uses the . (period) to represent the radix point, regardless of any decimal point
character specified as part of the current locale.
The syntax for the bc command is similar to that of the C language. You can use the bc command to
translate between bases by assigning the ibase keyword to the input base and the obase keyword to the
output base. A range of 2-16 is valid for the ibase keyword. The obase keyword ranges from 2 up to the
The output of the bc command is controlled by the program read. Output consists of one or more lines
containing the value of all executed expressions without assignments. The radix and precision of the
output are controlled by the values of the obase and scale keywords.
Further information about the way in which the bc command processes information from a source file is
described in the following sections:
v Grammar
v Lexical Conventions
v Identifiers and Operators
v Expressions
v Statements
v Function Calls
v Functions in -I Math Library
Grammar
The following grammar describes the syntax for the bc program, where program stands for any valid
program:
%token EOF NEWLINE STRING LETTER NUMBER
%token MUL_OP
/* ’*’, ’/’, ’%’ */
%token ASSIGN_OP
/* ’=’, ’+=’, ’-=’, ’*=’, ’/=’, ’%=’, ’^=’ */
%token REL_OP
/* ’==’, ’<=’, ’>=’, ’!=’, ’<’, ’>’ */
%token INCR_DECR
/* ’++’, ’--’ */
%token Define Break Quit Length
/* ’define’, ’break’, ’quit’, ’length’ */
%token Return For If While Sqrt
/* ’return’, ’for’, ’if’, ’while’, ’sqrt’ */
%token Scale Ibase Obase Auto
/* ’scale’, ’ibase’, ’obase’, ’auto’ */
%start program
%%
program : EOF
| input_item program
;
input_item : semicolon_list NEWLINE
| function
;
semicolon_list : /* empty */
| statement
| semicolon_list ’;’ statement
| semicolon_list ’;’
;
statement_list : /* empty */
| statement
| statement_list NEWLINE
| statement_list NEWLINE statement
| statement_list ’;’
| statement_list ’;’ statement
;
Lexical Conventions
The following lexical conventions apply to the bc command:
1. The bc command recognizes the longest possible lexical token or delimiter beginning at a given
point.
2. Comments begin with /* (slash, asterisk) and end with */ (asterisk, slash). Comments have no effect
except to delimit lexical tokens.
3. The newline character is recognized as the NEWLINE token.
4. The STRING token represents a string constant. The string begins with ″ (double quotation mark) and
terminates with ″ (double quotation mark). All characters between the quotation marks are taken
literally. There is no way to specify a string that contains ″ (double quotation mark). The length of
each string is limited to the maximum bytes set in the BC_STRING_MAX value, which is defined in
the limits.h file.
5. Blank characters have no effect except as they appear in the STRING token or when used to delimit
lexical tokens.
6. The \n (backslash, newline) character:
v delimits lexical tokens.
v is interpreted as a character sequence in STRING tokens.
v is ignored when part of a multiline NUMBER token.
7. A NUMBER token uses the following grammar:
NUMBER : integer
| ’.’ integer
| integer ’.’
|integer ’.’ integer
;
integer : digit
| integer digit
;
digit : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
| 8 | 9 | A | B | C | D | E | F
;
NUMBER token values are interpreted as numerals in the base specified by the ibase internal
register value.
8. The value of a NUMBER token is interpreted as a numeral in the base specified by the value of the
ibase internal register. Each of the digit characters has the value from 0 to 15 in the order listed here,
and the period character presents the radix point. The behavior is undefined if digits greater than or
equal to the value of the ibase register appear in the token. There is an exception for single-digit
values being assigned to the ibase and obase registers themselves.
9. The following keywords are recognized as tokens:
auto for length return sqrt
break ibase obase scale while
define if quit
10. Except within a keyword, any of the following letters are considered a LETTER token:
a b c d e f g h i j k l m n o p q r s t u v w x y z
11. The following single-character and two-character sequences are recognized as the ASSIGN_OP
token:
v = (equal sign)
Operators in a bc Program
Operator Associativity
++, - - not applicable
unary - not applicable
^ right to left
*, /, % left to right
+, binary - left to right
=, +=, -=, *=, /=, ^= right to left
==, <=, >=, !=, <, > none
Each expression or named expression has a scale, which is the number of decimal digits maintained as
the fractional portion of the expression.
Named expressions are places where values are stored. Named expressions are valid on the left side of
an assignment. The value of a named expression is the value stored in the place named. Simple
identifiers and array elements are named expressions; they have an initial value of zero and an initial
scale of zero.
The internal registers scale, ibase, and obase are all named expressions. The scale of an expression
consisting of the name of one of these registers is 0. Values assigned to any of these registers are
truncated to integers. The scale register contains a global value used in computing the scale of
expressions (as described below). The value of the scale register is limited to 0 <= sc