Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (a - b) ar(1)
NAME
ar - Creates and maintains archive files and libraries
SYNOPSIS
ar -d [-v][-l] archive file ...
ar -m [-abilv][position_name] archive file ...
ar -p [-v][-s] archive [file ...]
ar -q [-clv] archive [file ...]
ar -r [-cuv][-abil][position_name] archive file ...
ar -t [-v][-s][-Wfiletype] archive [file ...]
ar -Wobey obey_file
ar -x [-v][-sCT] archive [file ...]
FLAGS
In an ar command, you can list selected flags together in one group on the command line, with
no spaces between them. You can precede this single flag list with a - (dash), but it is not
required.
You must specify at least one flag from the required-flag set dmpqrtx. You can also specify any
number of optional flags from the set abcilsuvCT. If you select a positioning flag (a, b,ori), you
must also specify the name of a file within the library (position_name) immediately following the
flag list and separated from it by a space.
-a Positions new files in the archive after the file identified by the position_name
operand.
-b Positions new files in the archive before the file identified by the position_name
operand.
-c Suppresses the diagnostic message written to the standard error file by default
when the archive file archive is created.
-C Prevents extracted files from replacing like-named files in the file system. This
flag is useful with the -T flag to prevent truncated filenames from replacing files
with the same prefix.
-d Deletes the named files from the archive.
-i Positions new files in the archive before the file identified by the position_name
operand. (This flag is equivalent to the -b flag.)
-l Creates temporary files in the local current working directory, rather than in the
directory specified by the environment variable TMPDIR.
-m Moves the named files to some other position in the archive. By default, this flag
moves the named files to the end of the archive. Use the positioning flags (a, b,
or i) to specify a position other than the default position.
-p Writes the contents of the named files from archive to the standard output file. If
no files are specified, the contents of all files in the archive are written in the
order they occur in the archive.
527188-003 Hewlett-Packard Company 1−7