AR(1) — USER COMMANDS
NAME
ar − archive and library maintainer
SYNOPSIS
ar d|m|p|q|r|t|x [ ab position-name ] [ cilouv ] archive file-entry ...
DESCRIPTION
ar maintains library archives. A library is a set of files that have been combined into a single archive file (see ar(5)). ar is normally used to create and update library files used by the link editor ld(1), but can be used for any similar purpose.
archive is the archive file. file-entry is a file contained in the archive.
OPTIONS
You must indicate one of: d, m, p, q, r, t, or x, which may be followed by one or more of the modifiers abcilouv.
d Delete the named files from the archive file.
m Move the named files to the end of the archive.
p Display the named files in the archive.
q Quick append. Append the named files to the end of the archive file without searching the archive for duplicate names. Useful only to avoid quadratic behavior when creating a large archive piece-by-piece.
r Replace the named files in the archive.
t Display a table of contents of the archive file. If no names are given, all files in the archive are listed; if names are given, only those files are listed.
x Extract the named files. If no names are given, all files in the archive are extracted. In neither case does x alter the archive file.
MODIFIERS
a Place new files after posname (posname argument must be present). Applies only to the r and m options.
b Place new files before posname (posname argument must be present). Applies only to the r and m options.
c Normally ar creates archive when it needs to, and displays a message to this effect. The c modifier suppresses this message.
i Identical to the b modifier.
l Local. Ar places its temporary files in the directory /tmp. The l modifier places them in the local directory instead.
o Old date. When files are extracted with the x option, o sets the "last modified" date to the date recorded in the archive.
u Replace only those files that have changed since they were put in the archive. Used with the r option.
v Verbose. Give a file-by-file description of the creation of a new archive file from the old archive and the constituent files. When used with t, it gives a long listing of information about the files. When used with p, it precedes each file with a name.
EXAMPLES
Creating a new archive:
orpheus% ar rcv archive file.o
a - file.o
Adding to an archive:
orpheus% ar rav file.o archive next.c
a - next.c
Extracting from an archive:
orpheus% ar xv archive file.o
x - file.o
orpheus% ls file.o
file.o
Seeing the table of contents:
orpheus% ar t archive
file.o
next.c
FILES
/tmp/v∗ temporaries
SEE ALSO
lorder(1), ld(1), ranlib(1), ar(5)
BUGS
If the same file is mentioned twice in an argument list, it is put in the archive twice.
The "last-modified" date of a file will not be altered by the o option unless the user is either the owner of the extracted file or the superuser.
Sun Release 3.2 — Last change: 19 May 1986