ar – archive and library maintainer
maintains groups of files
combined into a single archive file,
The main use of
is to create and update library files for the loaders
It can be used, though, for any similar purpose.
is one character from the set
optionally concatenated with
one or more of
are constituents of the archive
The meanings of the
from the archive file.
in the archive file, or add them if missing.
Optional modifiers are
Replace only files with
modified dates later than that of
Place new files after
in the archive rather than at the end.
b or i
Place new files before
in the archive.
to the end of the archive without checking for duplicates.
Avoids quadratic behavior in
for (i in *.v) ar r lib.a $i .
List a table of contents of the archive.
If names are given, only those files are listed.
Print the named files in the archive.
Move the named files to the end or elsewhere,
specified as with
Preserve the access and modification times of files
extracted with the
Extract the named files.
If no names are given, all files in the archive are
In neither case does
alter the archive file.
Give a file-by-file
description of the making of a
new archive file from the old archive and the constituent files.
precede each file with a name.
give a long listing of all information about the files,
somewhat like a listing by
unhandled troff command .ns
mode uid/gid size date name
places its temporary files in the directory
This option causes them to be placed in the local directory.
is specified and all members of the archive are valid object files for
the same architecture,
inserts a table of contents, required by the loaders, at
the front of the library.
The table of contents is
rebuilt whenever the archive is modified, except
is specified or when the table of contents is
explicitly moved or deleted.
ar cr lib.a *.v
Replace the contents of library
with the object files in the current directory.
If the same file is mentioned twice in an argument list,
it may be put in the archive twice.
This command predates Plan 9 and makes some invalid assumptions,
for instance that user id’s are numeric.