This book is Volume 1 of the six-volume AIX 5L Version 5.1 Commands Reference, SBOF-1877, which contains reference information on operating system commands. It describes the tasks each command performs, how commands can be modified, how they handle input and output, who can run them, and provides a master index for all six volumes.
For a quick reference list of commands arranged in functional groups, see Volume 6.
This book is intended for users of operating system commands.
A command is a request to perform an operation or run a program. You use commands to tell the operating system what task you want it to perform. When commands are entered, they are deciphered by a command interpreter (also known as a shell) and that task is processed.
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).
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.|
Each command may include any of
the following sections:
|Purpose||A description of the major function of each command.|
|Syntax||A syntax diagram showing command line options.|
|Description||A discussion of the command describing in detail its function and use.|
|Flags||A list of command line flags and associated variables with an explanation of how the flags modify the action of the command.|
|Parameters||A list of command line parameters and their descriptions.|
|Subcommands||A list of subcommands (for interactive commands) that explains their use.|
|Exit Status||A description of the exit values the command returns.|
|Security||Specifies any permissions needed to run the command.|
|Examples||Specific examples of how you can use the command.|
|Files||A list of files used by the command.|
|Related Information||A list of related commands in this book and related discussions in other books.|
To list the installable software package (fileset) of an individual command use the lslpp command with the -w flag. For example, to list the fileset that owns the installp command, enter:
lslpp -w /usr/sbin/installp
Output similar to the following displays:
File Fileset Type ----------------------------------------------------------------- /usr/sbin/installp bos.rte.install File
To list the fileset that owns all file names that contain installp, enter:
lslpp -w "*installp*"
Output similar to the following displays:
File Fileset Type ----------------------------------------------------------------- /usr/sbin/installp bos.rte.install File /usr/clvm/sbin/linstallpv prpq.clvm File /usr/lpp/bos.sysmgt/nim/methods/c_installp bos.sysmgt.nim.client File
Operating system command syntax is represented by syntax diagrams and usage statements.
Syntax diagrams are designed to provide information about how to enter the command on the command line. A syntax diagram can tell you:
Operating system commands use the following conventions in their syntax diagrams:
The "Sample Syntax Diagram" illustrates the conventions used in syntax diagrams. Each part of the diagram is labeled. An explanation of the labels follows the diagram.
You interpret the example diagram
|0 PATH LINE||The path line begins the syntax diagram.|
|1 COMMAND NAME||This item in the diagram is the name of the command you want to invoke. It is in bold, which indicates that it must be entered exactly as it appears in the diagram.|
|2 SINGLE CHOICE BOX||If you follow the lower path, you encounter a box with the words one of over it. You can choose only one item from this box.|
|3 DEFAULT LINE||If you follow the upper path, you bypass the single choice box, and enter nothing. The bold line around the box is a default line, which means that you do not have to enter anything from that part of the diagram. Exceptions are usually explained under "Description." One important exception, the blank default line around input and output files, is explained in item 10.|
|4 REPEAT ARROW||When you follow a path that takes you to a box with an arrow around it, you must choose at least one item from the box. Then you can either follow the arrow back around and continue to choose items from the box, or you can continue along the path. When following an arrow that goes around a box (rather than an arrow that includes several branches in the diagram), do not choose the same item more than once.|
|5 REQUIRED ITEM||Following the branch with the repeat arrow is a branch with three choices and no default line around them. This means that you must choose one of A, B, or C.|
|6 GO TO NEXT LINE||If a diagram is too long to fit on one line, this character tells you to go to the next line of the diagram to continue entering your command. Remember, the diagram does not end until you reach the vertical mark.|
|7 CONTINUE DIAGRAM||This character shows you where to continue with the diagram after it breaks on the previous line.|
|8 OPTIONAL PARAMETER||If a flag can (but does not have to) take a parameter, the path branches after the flag. If you cannot enter a space between the flag and parameter, you are told in a footnote.|
|9 DEFAULT VALUE||Often, a command has default values or actions that it will follow if you
do not enter a specific item. These default values are indicated in
normal font in the default line if they are equivalent to something you could
enter on the command line (for example, a flag with a value). If the
default is not something you can enter on the command line, it is not
indicated in the diagram.
Note: Default values are included in the diagram for your information. It is not necessary to enter them on the command line.
|10 INPUT OR OUTPUT||A command that can read either input files or standard input has an empty
default line above the file parameter. If the command can write its
output to either an output file or to standard output, it is also shown with
an empty default line above the output file parameter.
If a command can read only from standard input, an input file is not shown in the diagram, and standard input is assumed. If a command writes only to standard output, an output file is not shown in the diagram, and standard output is assumed.
|11 FOOTNOTE||If a command has special requirements or restrictions, a footnote calls attention to these differences.|
|12 VERTICAL MARK||This ends the syntax diagram.|
If you are going to run a command that takes a long time to process, you can specify that the command run in the background. Background processing is a useful way to run programs that process slowly. To run a command in the background, you use the & (ampersand) operator at the end of the command:
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.
You typically enter commands following the shell prompt on the command line. The shell prompt can vary. In the following examples, $ is the prompt.
To display a list of the contents of your current directory, you would type ls and press the Enter key:
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 general format for entering commands is:
Command Flag(s) Parameter
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 entering commands, it is important to remember the following:
$ cat /usr/ust/mydir/mydata > \ /usr/usts/yourdir/yourdata
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.
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 registered quality systems were used in the development and manufacturing of this product.
Beginning with Version 4.3, the operating system is designed to
support The Open Group's UNIX98 Specification for portability of
UNIX-based operating systems. Many new interfaces, and some current
ones, have been added or enhanced to meet this specification, making Version
4.3 even more open and portable for applications.
At the same time, compatibility with previous releases of the operating system is preserved. This is accomplished by the creation of a new environment variable, which can be used to set the system environment on a per-system, per-user, or per-process basis.
To determine the proper way to develop a UNIX98-portable application, you may need to refer to The Open Group's UNIX98 Specification, which can be obtained on a CD-ROM by ordering Go Solo 2: The Authorized Guide to Version 2 of the Single UNIX Specification, ISBN: 0-13-575689-8, a book which includes The Open Group's UNIX98 Specification on a CD-ROM.
The following books contain information about or related to commands:
The following terms are trademarks of International Business Machines Corporation in the United States, other countries, or both:
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other company, product, or service names may be the trademarks or service marks of others.