ar(1)
NAME
ar − archive and library maintainer
SYNTAX
ar −key [posname] afile name...
DESCRIPTION
The ar command maintains groups of files combined into a single archive file. The ar command is used to create and update library files as they are used by the loader.
This version of ar uses a ASCII-format archive, which can be used by the various machines running UNIX. Programs for dealing with older formats are also available. For further information, see arcv(.).
The key is one character from the following set: d, r, q, t, p, m, x. The key character can be concatenated with one or more of the following optional characters: v, u, a, i, b, c, l, o. The afile is the archive file. The names are constituent files in the archive file.
OPTIONS
The OPTIONS section is divided into two sections: the first section lists the key characters and their meanings, and the second section lists the optional characters and their meanings.
For backward compatibility, the keys work without the dash (−). The definitions of the key characters are as follows:
5
Deletes the named files from the archive file.
m
Moves the named files to the end of the archive. If a positioning character is present, then the posname argument must be present and, as in r, it will specify where the files are to be moved.
p
Prints the named files in the archive.
q
Appends the named files to the end of the archive file. Optional positioning characters are invalid. The command does not check whether the added files are already in the archive. The q option is used primarily to avoid quadratic behavior when you are creating a large archive piece-by-piece.
r
Replaces the named files in the archive file. If the optional character u is used with r, then only those files with last-modified dates later than the archive files are replaced. If an optional positioning character from the set a, b, or i is used, then the posname argument must be present and it specifies that new files should be placed after (a) or before (b or i) posname. Otherwise new files are placed at the end.
t
Prints a table of contents of the archive file. If no names are given, all files in the archive are included in the table of contents. If file names are specified, only those files are included in the table of contents.
x
Extracts the named files. If no names are given, all files in the archive are extracted. However, x does not alter the archive file. Normally the last-modified date of each extracted file is the date when it is extracted. However, if o is used, the last-modified date is reset to the date recorded in the archive.
The following optional characters can be used in conjunction with the key characters:
aTells the ar command that new files should be placed after posname.
bTells the ar command that new files should be placed before posname.
cSuppresses the message that is normally produced when afile is created.
iTells the ar command that new files should be placed before posname.
lPlaces files in the local directory instead of the /tmp directory where they are normally placed.
oResets the last-modified date to the date recorded in the archive. Normally the last-modified date is the date when the file was extracted.
uReplaces only those files with last-modified dates later than the archive files. See the r key character.
vGives a file-by-file description of the making of a new archive file from the old archive and the constituent files. When used with the t option, it gives a long listing of all information about the files. When used with the p option, it precedes each file with a name.
RESTRICTIONS
The ar command truncates the filenames to 15 characters.
If the same file is mentioned twice in an argument list, it may be put in the archive twice.
The last-modified date of a file is not altered by the o option if the user is not the owner of the extracted file or a super-user.
FILES
/tmp/v*temporaries