ar(1)ar(1)NAMEar - archive library maintainer
SYNOPSISar-d [-vV] [-l] archive file...
ar-h [-lvV] [-s] archive [file...]
ar-m [-abilvVzZ] [posname] archive file...
ar-p [-vV] [-s] archive file...
ar-q [-clvVzZ] archive file...
ar-r [-cuvVzZ] [-abil] [posname] archive file...
ar-R [-lvVzZ] [-s] archive
ar-t [-vV] [-s] archive file...
ar-w [-lvV] [-s] archive
ar-x [-vV] [-osCT] archive file...
ar-input file
The token -- (double-dash) is accepted as a delimiter indicating the
end of options. Any following arguments are treated as operands, even
if they begin with the - character.
The following options and suboptions are Tru64 UNIX extensions to the
standard ar utility:
Options: -h, -input, -w, -R
Suboptions: -o, -z, -Z
STANDARDS
Interfaces documented on this reference page conform to industry stan‐
dards as follows:
ar: XPG4-UNIX
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
OPTIONS
The following options are supported: Positions new files in the archive
after the existing file named by the posname operand. Positions new
files in the archive before the existing file named by the posname op‐
erand. Suppresses the diagnostic message that the archiver prints when
it creates the specified archive file. Prevents extracted files from
replacing like-named files in the file system. When -T is also used,
this option is useful to prevent truncated file names from replacing
files with the same prefix. Deletes the specified files from the ar‐
chive file. [Tru64 UNIX] Sets the file modification times in the mem‐
ber headers of the named files to the current date and time. If you do
not specify any filenames, ar sets the time stamps of all member head‐
ers. Positions new files in the archive before the existing file named
by the posname operand (equivalent to -b). [Tru64 UNIX] Directs ar to
read the contents of file file as if the contents had been supplied on
the command line.
Inside file, lines ending with a \ (backslash) are treated as
continuation lines, and lines starting with # are treated as
comment lines and ignored. The -v option can be used to display
the expansion of the command line resulting from the use of
-input. The files can be nested up to 20 levels. Places tempo‐
rary files in the local current working directory, instead of in
the directory specified by the environment variable TMPDIR or in
the default directory.
This option is scheduled to be withdrawn from a future version
of the X/Open CAE Specification. Moves the specified files. The
-a, -b, or -i suboptions with the posname operand indicate the
position. Otherwise, moves the files to the end of the archive.
[Tru64 UNIX] Forces a newly created file to have the last-modi‐
fied date that it had before it was extracted from the archive.
Prints the contents of the specified files from the archive. If
no files are specified, the contents of all files are printed in
the order of the archive. Quickly appends the specified files
to the end of the archive file. The archiver does not check
whether the added members are already in the archive. This is
useful to bypass the searching otherwise done when creating a
large archive piece by piece. Replaces or adds the specified
files to the archive. If the archive named by archive does not
exist, a new archive file is created. Files that replace exist‐
ing files do not change the order of the archive. New files are
appended to the archive. [Tru64 UNIX] Replicates the entire
archive, transferring each file in the archive to the replica in
uncompressed form. If the -Z option is also specified, each file
in the archive is transferred to the replica in compressed form.
[XPG4-UNIX] Makes a symbol definition file (“symdef” file) as
the first file of an archive. This file contains a hash table of
ranlib structures and a corresponding string table. If you
change the archive contents, the “symdef” file becomes obsolete
because archive file symbols change. The ar command builds the
symbol table by default. Prints a table of contents for the
files in archive. The table includes the files specified by the
file operands. If no file names are specified, all files in ar‐
chive are included in the order in which they appear in the ar‐
chive. Allows filename truncation of extracted files whose ar‐
chive names are longer than the file system can support. By
default, extracting a file with a name that is too long is an
error; a diagnostic message is written and the file is not
extracted. Updates older files. When used with the -r option,
files within the archive are replaced only if the corresponding
file has a modification time that is at least as new as the mod‐
ification time of the file within the archive. Gives verbose
output. When used with options -d, -r, or -x, writes a detailed
file-by-file description of the archive creation and maintenance
activity.
When used with option -p, the archiver precedes each file with a
name.
When used with option -t, the archiver lists all information
about the files in the archive, indicating that a file has been
compressed by placing a “Z” in the column that precedes the
filename. Displays the version of the ar command. [Tru64
UNIX] Displays the archive symbol table. Each symbol is listed
with the name of the archive member that defines the symbol.
Extracts the specified files from the archive. The contents of
the archive is not changed. If no file names are given, the
archiver extracts all files. The modification time of each file
extracted is set to the time the file is extracted from the ar‐
chive, unless the -o option is also used. In the case of the -o
option, the archiver resets the last-modified date to the date
recorded in the archive. [Tru64 UNIX] Suppresses symbol table
building. [Tru64 UNIX] Compresses each file as it is added to
the archive.
OPERANDS
The archive being created or modified. The name of a file member
either in an archive or being added to an archive. The name of an ar‐
chive file member.
DESCRIPTION
The (ar) utility creates and maintains groups of files combined into a
single archive file. Generally, you use this utility to create and
update library files that the link editor uses; however, you can use
the archiver for any similar purpose.
When ar creates an archive, it creates administrative information in a
format that is portable across all machines. When the archive contains
at least one object file that ar recognizes as such, an archive symbol
table, which the link editor uses to search the archive file, is cre‐
ated. Whenever ar is used to create or update the contents of such an
archive, the symbol table is rebuilt. The -s option forces the symbol
table to be rebuilt.
The ar(1) utility supports file name lengths up to the limit supported
by the operating system.
RESTRICTIONS
If you specify the same file twice in an argument list, it can appear
twice in the archive file.
The -o suboption does not change the last-modified date of a file
unless you own the extracted file or you are the superuser.
The -s suboption is not operative as ar will always build the hash ta‐
ble by default unless the -z suboption is specified.
ENVIRONMENT VARIABLES
The following environment variables affect the behavior of ar: Provides
a default value for the locale category variables that are not set. If
set, overrides the values of all other locale variables. Determines
the locale for the interpretation of byte sequences as characters (sin‐
gle-byte or multibyte) in input parameters and files. Determines the
locale used to affect the format and contents of diagnostic messages
displayed by the command. Determines the format and content for date
and time strings written by ar-tv. Determines the location of message
catalogs for processing of LC_MESSAGES. Determines the pathname that
overrides the default directory for temporary files, if any.
FILES
Temporary files
SEE ALSO
Commands: ld(1), lorder(1)
Files: ar(4)
Standards: standards(5)ar(1)