date and time created 89/03/05 21:18:53 by bostic
[unix-history] / usr / src / usr.bin / ar / ar.1
CommitLineData
58e87b18 1.\" @(#)ar.1 6.1 (Berkeley) %G%
ca4c99eb 2.\"
58e87b18 3.TH AR 1 ""
ca4c99eb
KM
4.AT 3
5.SH NAME
6ar \- archive and library maintainer
7.SH SYNOPSIS
8.B ar
9key [ posname ] afile name ...
10.SH DESCRIPTION
11.I Ar
12maintains groups of files
13combined into a single archive file.
14Its main use
15is to create and update library files as used by the loader.
16It can be used, though, for any similar purpose.
17.B N.B:
18This version of
19.I ar
20uses a ASCII-format archive which is portable among the various
21machines running \s-2UNIX\s0.
22Programs for dealing with older formats are available: see
84dbc84a 23.IR arcv (8).
ca4c99eb
KM
24.PP
25.I Key
26is one character from the set
27.B drqtpmx,
28optionally concatenated with
29one or more of
84dbc84a 30.B vuaibclo.
ca4c99eb
KM
31.I Afile
32is the archive file.
33The
34.I names
35are constituent files in the archive file.
36The meanings of the
37.I key
38characters are:
39.TP
40.B d
41Delete the named files from the archive file.
42.TP
43.B r
44Replace the named files in the archive file.
45If the optional character
46.B u
47is used with
48.B r,
84dbc84a 49then only those files with `last-modified' dates later than
ca4c99eb
KM
50the archive files are replaced.
51If an optional positioning character from the set
52.B abi
53is used, then the
54.I posname
55argument must be present
56and specifies that new files are to be placed
57after
58.RB ( a )
59or before
60.RB ( b
61or
62.BR i )
63.IR posname .
64Otherwise
65new files are placed at the end.
66.TP
67.B q
68Quickly append the named files to the end of the archive file.
69Optional positioning characters are invalid.
70The command does not check whether the added members
71are already in the archive.
72Useful only to avoid quadratic behavior when creating a large
73archive piece-by-piece.
74.TP
75.B t
76Print a table of contents of the archive file.
77If no names are given, all files in the archive are tabled.
78If names are given, only those files are tabled.
79.TP
80.B p
81Print the named files in the archive.
82.TP
83.B m
84Move the named files to the end of the archive.
85If a positioning character is present,
86then the
87.I posname
88argument must be present and,
89as in
90.B r,
91specifies where the files are to be moved.
92.TP
93.B x
94Extract the named files.
95If no names are given, all files in the archive are
96extracted.
97In neither case does
98.B x
84dbc84a
KM
99alter the archive file. Normally the `last-modified' date of each
100extracted file is the date when it is extracted. However, if
101.B o
102is used, the `last-modified' date is reset to the date recorded in the
103archive.
ca4c99eb
KM
104.TP
105.B v
106Verbose.
107Under the verbose option,
108.I ar
109gives a file-by-file
110description of the making of a
111new archive file from the old archive and the constituent files.
112When used with
113.B t,
114it gives a long listing of all information about the files.
115When used with
116.BR p ,
117it precedes each file with a name.
118.TP
119.B c
120Create.
121Normally
122.I ar
123will create
124.I afile
125when it needs to.
126The create option suppresses the
127normal message that is produced when
128.I afile
129is created.
130.TP
131.B l
132Local.
133Normally
134.I ar
135places its temporary files in the directory /tmp.
136This option causes them to be placed in the local directory.
137.SH FILES
138/tmp/v* temporaries
139.SH "SEE ALSO"
84dbc84a 140lorder(1), ld(1), ranlib(1), ar(5), arcv(8)
ca4c99eb
KM
141.SH BUGS
142If the same file is mentioned twice in an argument list,
143it may be put in the archive twice.
84dbc84a
KM
144.LP
145The `last-modified' date of a file will not be altered by the
146.B o
147option if the user is not the owner of the extracted file, or the super-user.