Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > I


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


introduction — HP-UX operating system and HP-UX Reference


HP-UX is the Hewlett-Packard Company's implementation of a UNIX® operating system that is compatible with various industry standards. It is based on the System V Release 4 operating system (SVR4) and includes important features from the Fourth Berkeley Software Distribution (4BSD).

Improvements include enhanced capabilities and other features, developed by HP to make HP-UX a very powerful, useful, and reliable operating system, capable of supporting a wide range of applications ranging from simple text processing to sophisticated engineering graphics and design. It can readily be used to control instruments and other peripheral devices. Real-time capabilities further expand the flexibility of HP-UX as a powerful tool for solving tough problems in design, manufacturing, business, and other areas where responsiveness and performance are important.

Extensive international language support enables HP-UX to interact with users in any of dozens of human languages. HP-UX interfaces easily with local area networks and resource-sharing facilities. By using industry-standard protocols, HP-UX provides flexible interaction with other computers and operating systems. Optional software products extend HP-UX capabilities into a broad range of specialized needs.

The HP-UX Reference is not a learning tool for beginners. It is primarily a reference tool that is most useful for experienced users of UNIX or UNIX-like systems. If you are not already familiar with UNIX or HP-UX, refer to the series of Beginner's Guides, tutorial manuals, and other learning documents supplied with your system or available separately. System implementation and maintenance details are explained in the HP-UX System Administrator's Guide.


This introduction and the section intro manpages describe the "core" manpages that are delivered with HP-UX. Other manpages may be delivered separately with optional HP-UX and third-party software and may reside in the same directories as the core manpages, or in other directories.


The contents of the HP-UX Reference and its on-line counterpart are a number of independent entries called manpages. These are also called manual entries or reference pages.

For convenient reference, the manpages are divided into eight specialized sections. The printed manual also has a table of contents for each volume and a composite index.

Each manpage consists of one or more printed pages, with the manpage name and section number printed in the upper corners. Manpages are arranged alphabetically within each section of the reference, except for the intro page at the beginning of each section. Manpages are referred to by name and section number, in the form pagename (section).

The manpages are available on-line through the man command if the manpages are present on the system. Refer to the man(1) manpage in Section 1 for more information.

Each page in the printed manual has two page numbers, printed at the bottom of the page. The center page number starts over with page 1 at the beginning of each new manpage; it is placed between two dashes in normal typeface. The number printed at the outside corner on each page is the sequence number of the page within the volume. Users usually locate manpages by the alphabetic headings at the top of the page as when reading a dictionary.

Some manpages describe two or more commands or routines. In such cases, the manpage is usually named for the first command or function that appears in the NAME section. Occasionally, a manpage name appears as a group descriptor in the NAME section. In such instances, the name describes the commands or functions in more general terms. For example, the acct(1M) manpage with group descriptor acct: describes the acctdisk, acctdusg, accton, and other commands, while the string(3C) manpage with group descriptor string: describes many character string functions.


The HP-UX Reference contains the following sections:

Volume Table of Contents (Printed Volumes)

A complete listing of all manpages in the order they appear in each section, as well as alphabetically intermixed lists of all command, function, and feature names that are different from the manpage where they appear.

Section 1: User Commands

Programs that are usually invoked directly by users or from command language procedures (scripts).

Section 1M: System Administration Commands

Commands used for system installation and maintenance, including boot processes, crash recovery, system integrity testing, and other needs. Most commands in this section require the superuser privilege.

Section 2: System Calls

Entries into the HP-UX kernel, including the C-language interface. These topics are primarily of interest to programmers.

Section 3: Library Functions

Available subroutines that reside (in binary form) in various system libraries. These topics are primarily of interest to programmers.

Section 4: File Formats

The structure of various types of files, such as header files, primarily of interest to administrators and programmers. For example, the link editor output file format is described in a.out(4). Files that are used only by a single command (such as intermediate files used by assemblers) are not described. C-language declarations corresponding to the formats in Section 4 can be found in the directories /usr/include and /usr/include/sys.

Section 5: Miscellaneous Topics

A variety of information, such as descriptions of character sets, macro packages, and kernel tunables.

Section 6 (Unused)

This section was traditionally used for games. None are shipped with HP-UX.

Section 7: Device Special Files

The characteristics of device special files (DSF) that provide the link between HP-UX and system I/O devices. The names for each topic usually refer to the type of I/O device rather than to the names of individual special files.

Section 8: System Administration Commands

Some UNIX and Linux vendors put system administration commands here. Some third party vendors install commands in this section in HP-UX.

Section 9: General Information

General introductions (such as this) and a glossary of terms used in the HP-UX environment.

This section is also used by the Driver Development Kit to store its function and structure manpages, using the section numbers 9E, 9F, and 9S.

Composite Index (Printed Manual)

An alphabetical listing of keywords and topics based on the NAME section near the beginning of each manpage as well as other information, cross-referenced to manpage names and sections. The index also contains references to built-in features in the various command interpreters ("shells").


All manpages follow an established section heading format, but not all section headings are included in each manpage. A few manpages have self-explanatory specialized headings.


Gives the names of the commands, functions, or features and briefly states the purpose.


Summarizes the syntax of the command or program entity. A few conventions are used:

Constant-width characters indicate literal characters that should be entered exactly as they appear. These characters appear in bold in the online manpages.

Italic strings represent variable elements that should be replaced with appropriate values.

Roman square brackets ([]) indicate that the contents are optional.

Roman braces ({}) indicate a required element, usually in a choice.

Ellipses (...) indicate that the previous element and its preceding whitespace (if any) can be repeated.

Note: An argument beginning with a dash (-), a plus sign (+), or an equal sign (=) is often defined as a command option, even if it appears in a position where a file name could appear. Therefore, it is unwise to have files names that begin with -, +, or =.

Optional subsections can include the following:


For functions, a description of the parameters in the preceding syntax.

Structure Members

For structures, a description of the structure elements in the preceding syntax.


Information about special software or hardware requirements.


Discusses the function and behavior of each entry.

Optional subsections can include the following:


For commands, a description of the switch arguments.


For commands, a description of the nonswitch arguments and keywords.

Access Control Lists

Multithread Usage

Security Restrictions

Information on restrictions and privileges required to use the item.


Information on what external factors, such as environment variables, may affect system behavior.

Optional subsections can include the following:

Environment Variables

The effect of language-related and other environment variables on system behavior,

International Code Set Support

Whether there is support for single- and multibyte characters,


Information under this heading is applicable only if you are using the network feature described there.

Optional subsections can include the following:


Information on the network file system.


Describes the values returned by function calls or in the return code ($?) by commands.


For commands, the diagnostic information that may be produced. Self-explanatory messages are not listed.

Optional subsections can include the following:




For functions, the function error values (set in errno) and their corresponding error conditions.


Examples of typical usage.


Potential problems and deficiencies.


Variations in HP-UX operation that are related to the use of specific hardware, software, or combinations of hardware and software.


Indicates the principal developer of the software documented by the manpage. Unless noted otherwise, the source of an entry is System V.


The file names that are used or affected by the program or command.


Provides references to related manpages and other documentation.


For each command or subroutine entry point addressed by one or more of the following industry standards, the standard specifications to which that HP-UX component conforms.

The various standards are:


OSF Application Environment Specification


ANSI X3.159-1989

FIPS 151-1

Federal Information Processing Standard 151-1 (National Institute of Standards and Technology)

FIPS 151-2

Federal Information Processing Standard 151-2 (National Institute of Standards and Technology)


IEEE Standard 1003.1-1988 (IEEE Computer Society) (Portable Operating System Interface for Computer Environments)


IEEE Standard 1003.2-1990 (IEEE Computer Society) (Portable Operating System Interface for Computer Environments)


IEEE Standard 1003.1b-1993 (IEEE Computer Society) (Portable Operating System Interface for Computer Environments)


System V Interface Definition Issue 2


System V Interface Definition Issue 3


X/Open Portability Guide Issue 2 (X/Open, Ltd.)


X/Open Portability Guide Issue 3 (X/Open, Ltd.)


X/Open Portability Guide Issue 4 (X/Open, Ltd.)


X/Open Portability Guide Issue 4 Version 2 (X/Open, Ltd.)


This is a very brief overview of how to use the HP-UX system: how to log in and log out, how to communicate through your machine, and how to run a program.

HP-UX uses control characters to perform certain functions. Control characters are generally shown in the form ^x, such as ^D for Control-D. Hold down the Control (Ctrl) key while you press the character key.

Note: The key names Enter and Return refer to the same key.

Logging In

To log in you must have a valid user name and password, which can be obtained from your system administrator.

When a connection has been established, the system displays login: on your terminal. Type your user name and press the Enter key. Enter your password (it is not echoed by the system) and press Enter.

A list of copyright notices and a message-of-the-day may greet you before the first prompt.

It is important that you type your login name with lowercase letters, if possible. If you type uppercase letters, HP-UX assumes that your terminal cannot generate lowercase letters, and treats subsequent uppercase input as lowercase.

When you log in successfully, the system starts your login shell. The default is the POSIX shell, /usr/bin/sh. The POSIX shell (and its predecessors, the Korn and Bourne shells) use $ as the default prompt for users. The C shell uses %. All the shells use # as the default superuser prompt.

See login(1) for more on login, passwd(1) to change your password, chsh(1) to change your login shell.

Logging Out

You can log out of the shells by typing an exit command or the eof (end-of-file) character (see the Special Interactive Characters subsection below). The shell terminates and the login: prompt appears again. (If you are using the C, Korn, or POSIX shells, respectively, see csh(1), ksh(1), or sh-posix(1) for information about the ignoreeof special command.)

How to Communicate Through Your Terminal

HP-UX gathers keyboard input characters and saves them in a buffer. The accumulated characters are not passed to the shell or other program until you type Enter.

HP-UX terminal input/output is full-duplex. It has full read-ahead, which means that you can type at any time, even while a program is printing on your display or terminal. Of course, if you type during output, the output display will have the input characters interspersed in it. However, whatever you type will be saved and interpreted in the correct sequence. There is a limit to the amount of read-ahead, but it is generous and not likely to be exceeded unless the system is severely overloaded or operating abnormally. When the read-ahead limit is exceeded, the system throws away all the saved characters.

The stty(1) manpage tells you how to describe the characteristics of your terminal to the system. The profile(4) manpage explains how to accomplish this task automatically every time you log in.

Special Interactive Characters

A number of special characters are used to control the input and output of your terminal. These characters have defaults and can be redefined with the stty command (see stty(1)). Definitions of the stty names are in termio(7) and termiox(7).

Note: The system administrator can modify the system login defaults by changing the characteristics of the /dev/ttyconf device file with the stty command.

sttySystem Default At LoginCommon User
NameCharacter (ASCII Name; Key Names)Redefinition
eof^D (EOT) 
erase#^H (BS; Backspace)
kill@^U (NAK), ^X (CAN)
intr^? (DEL; Delete, Rub, Rubout)^C (ETX)
quit^\ (FS) 
start^Q (DC1; X-ON) 
stop^S (DC3; X-OFF) 

The eof character terminates "file" input from the terminal, as read by programs and scripts. By extension, eof can also terminate the shell (see the Logging Out subsection above).

The erase character erases the last character typed. Successive uses of erase will erase characters back to, but not beyond, the beginning of the input line.

The kill character deletes all characters typed before it on a terminal input line.

The intr character generates an interrupt signal that bypasses the input buffer. This signal generally causes whatever program you are running to terminate. It can be used to stop a long printout that you don't want. However, programs can arrange either to ignore this signal altogether, or to be notified when it happens (instead of being terminated). For example, the vi editor catches interrupts and stops what it is doing, instead of terminating, so that an interrupt can be used to halt an editing operation without losing the file being edited.

The quit character generates a quit signal that bypasses the input buffer and most program traps and causes a running program to terminate. It can cause a core dump in the current directory.

The stop character can be used to pause output to the terminal. It is commonly used on video terminals to suspend output to the display while you read what is already being displayed. You can then resume output by typing the start character. When stop and start are used to suspend or resume output, they bypass the keyboard command-line buffer and are not passed to the program. However, any other characters typed on the keyboard are saved and used as input later in the program.

The eof, erase, and kill characters can be used as normal text characters if you escape them with a preceding \, as in \^D. Therefore, to erase a \, you need two erases.

The intr, quit, start, and stop characters cannot be escaped on the input line.

End-of-Line and Tab Characters

Besides adapting to the speed of the terminal, HP-UX tries to be intelligent as to whether you have a terminal with a newline (line-feed) key, or whether it must be simulated with a return/line-feed character pair. In the latter case, all incoming return characters are changed to line-feed characters (the standard line delimiter), and a return/line-feed pair is echoed to the terminal. If you get into the wrong mode, use the stty command to correct it (see stty(1)).

Tab characters are used freely in HP-UX source programs. If your terminal does not have the tab function, you can arrange to have tab characters changed into spaces during output, and echoed as spaces during input. The stty command sets or resets this mode. By default, the system assumes that tabs are set every eight character positions. The tabs command (see tabs(1)) can set tab stops on your terminal, if the terminal supports tabs.

How to Run a Program

When you have successfully logged into HP-UX, the shell monitors input from your terminal. The shell accepts typed lines from the terminal, splits them into command names and arguments, then executes the command. The command can be the name of a shell built-in, an executable script of commands, or an executable program. There is nothing special about system-provided commands, except that they are kept in directories where the shell can find them. You can also keep commands in your own directories and arrange for the shell to find them there.

The command name is the first word on an input line to the shell; the command and its arguments are separated from one another by blanks (one or more space and/or tab characters).

When a program terminates, the shell ordinarily regains control and prompts you to indicate that it is ready for another command. The shell has many other capabilities, which are described in detail in the appropriate manpages: sh-posix(1) for the POSIX shell, ksh(1) for the Korn shell, or csh(1) for the C shell.

The Current Directory

HP-UX has a file system arranged in a hierarchy of directories. When the system administrator gave you a user name, he or she also created a directory for you (ordinarily with the same name as your user name, and known as your login or home directory). When you log in, that directory becomes your current or working directory, and any file name you type is assumed to be in that directory by default. Because you are the owner of this directory, you have full permission to read, write, alter, or destroy its contents. The permissions you have for other directories and files will have been granted or denied to you by their respective owners, or by the system administrator. To change the current working directory use the cd command (see cd(1)).

Path Names

To refer to files not in the current directory, you must use a path name. Full (absolute) path names begin with /, which is the name of the root directory of the whole file system. After the slash comes the name of each directory containing the next subdirectory (followed by a /), until finally the file name is reached (for example, /usr/ae/filex refers to file filex in directory ae, while ae is itself a subdirectory of usr; usr is a subdirectory of the root directory). See glossary(9) for a formal definition of path name.

If your current directory contains subdirectories, the path names of files in them begin with the name of the corresponding subdirectory (without a prefixed /). Generally, a path name can be used anywhere a file name is required.

Important commands that modify the contents of directories are cp, mv, and rm which respectively copy, move (that is, rename, relocate, or both), and remove files. To determine the status of files or the contents of directories, use the ls command. Use mkdir to make directories, rmdir to destroy them, and mv to rename them. See cp(1), ls(1), mkdir(1), mv(1), rm(1), and rmdir(1).

Writing a Program

To enter the text of a source program into an HP-UX file, use a text editing program such as vi, ex, or ed (see vi(1), ex(1), and ed(1)). The three principal languages available under HP-UX are C (see cc_bundled(1) and cc(1)), FORTRAN (see f77(1)), and aC++ (see aCC(1)). After the program text has been entered with the editor and written into a file (whose name has the appropriate suffix), you can give the name of that file to the appropriate language processor as an argument. Normally, the output of the language processor will be left in a file named a.out in the current directory. Since the results of a subsequent compilation may also be placed in a.out, thus overwriting the current output, you may want to use mv to give the output a unique name. If the program is written in assembly language, you will probably need to link library subroutines with it (see ld(1)). FORTRAN, C, and aC++ call the linker automatically.

When you have gone through this entire process without encountering any diagnostics, the resulting program can be run by giving its name to the shell in response to the prompt.

Your programs can receive arguments from the command line just as system programs do by using the argc and argv parameters. For more information, see your language's Programmer's Guide.

Text Processing

Almost all text is entered through a text editor. The editor preferred above all others provided with HP-UX is the vi editor. For batch-processing text files, the sed editor is very efficient. The ex editor is useful for handling certain situations while using vi but most other editors are rarely used except in various scripts.

The following editors are the same program masquerading under various names: vi, view, and vedit (see vi(1)) and ex and edit (see ex(1)). For information about the sed stream editor, see sed(1). The ed line editor is described in ed(1).

The commands most often used to display text on a terminal are cat, more, and pr. See cat(1), more(1), and pr(1). The cat command simply copies ASCII text to the terminal, with no processing at all. The more command displays text on the terminal a screenful at a time, pausing for an acknowledgement from the user before continuing. The pr command paginates text, supplies headings, and has a facility for multicolumn output. pr is most commonly used in conjunction with the lp command (see lp(1)) to pipe formatted text to a line printer.

Interuser Communication

Certain commands provide interuser communication. Even if you do not plan to use them, it could be beneficial to learn about them, because someone else may direct them toward you. To communicate with another user that is currently logged in, you can use write to transfer text directly to that user's terminal display (if permission to do so has been granted by the other user). Otherwise, elm, mailx, or mail (in order of ease of use) can send a message to another user's mailbox. The user is then informed by HP-UX that mail has arrived (if currently logged in) or mail is present (when the user next logs in). Refer to elm(1), mail(1), mailx(1), and write(1) for explanations of how these commands are used.


UNIX is a registered trademark of The Open Group.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.