AR(1) — Unix Programmer’s Manual
NAME
ar − archive and library maintainer
SYNOPSIS
ar key [ posname ] afile files
DESCRIPTION
Ar maintains groups of files combined into a single archive file. Its main purpose is to create and update library files as used by the loader. It can be used, however, for any similar task. Note that this version of ar uses an ASCII format archive which is portable among the various machines running UNIX.
Key is one character from the set d m p q r t x, optionally concatenated with one or more of the set a b c i l o u v. Afile is the archive file. The files are constituent files in the archive file.
KEY CHARACTERS
c Create. Normally ar will create afile when necessary. The “create” option suppresses the normal message that is produced when afile is created.
d Deletes the named files from the archive file.
l Local. Normally ar places its temporary files in the directory /tmp. This option causes them to be placed in the local directory.
m[pc] [posname]
Moves the named files to the end of the archive. If an optional positioning character (pc) from the set abi is used, then the posname argument must be present, specifying where new files are to be placed relative to posname. Otherwise, new files are placed at the end.
aPosition character after posname.
bPosition character before posname.
iPosition character before posname.
p Prints the named files in the archive.
q Quickly appends the named files to the end of the archive file. Optional positioning characters are invalid. The command does not check whether the added members are already in the archive. Useful only to avoid quadratic behavior when creating a large archive piece by piece.
r[option][pc] [posname]
Replaces the named files in the archive file.
u“You have new mail” is given. If given while editing a mailbox file with the −f flag, then the edit file is rewritten. A return to the shell is effected, unless the rewrite of edit file fails, in which case the user can escape with the exit command.
reply (r) Sends mail to the sender and all recipients of the specified message. The default message must not be deleted.
Reply (R) Reply to originator. Does not reply to other recipients of the origracter u is used with r, then only those files with “last-modified” dates later than the archive files are replaced.
pcIf an optional positioning character (pc) from the set abi is used, then the posname argument must be present, specifying where new files are to be placed relative to posname. Otherwise, new files are placed at the end.
aPosition character after posname.
bPosition character before posname.
iPosition character before posname.
t Prints a table of contents of the archive file. If no files are given, all files in the archive are tabled. If files are given, only those files are tabled.
v Verbose. Under the verbose option, ar gives a file-by-file description of the making of a new archive file from the old archive and the constituent files.
pWhen used with p, it precedes each file with a name.
tWhen used with t, it gives a long listing of all information about the files.
x Extracts the named files. If no files are given, all files in the archive are extracted. In neither case does x alter the archive file. Normally the last-modified date of each
INTEGRATED SOLUTIONS 4.2 BSD — 1 August 1985