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