AR ( 1 ) USER COMMANDSAR ( 1 )


NAME

ar - create and maintain library archives

SYNOPSIS

ar [ options ] lib [file] ...

DESCRIPTION

ar invokes the underlying library command to create, modify, and extract from archives. With the -t option invokes pax to list the contents of archives. An archive is a single file holding a collection of object files that can be used for creating executables.

All file operands can be pathnames. However, for archives created by ar, files within archives are the basenames for files. The comparison of file to names of files in lib will be done by comparing the last component of file to the archive name.

The original file contents, mode, times, owner, and group are preserved in the archive and may be reconstituted on extraction.

OPTIONS

-d, --remove
Delete each file from the archive.
-p, --print
Writes the contents of the files from lib to standard output. If no file is specified, all of the files in lib are written to standard output.
-r, --replace
Replace or add each file to archive lib. If the archive does not exist, a new archive created and unless the -c option is specified a diagnostic message is written to standard error.
-t, --list
Writes the table of contents for the specified files or the complete contents if no file is specified.
-x, --extract
Extract each file from lib. The contents of lib are not changed. If file is omitted, all files in the archive are extracted. The modification time on the extracted file is set to the time of the file in the archive.
-D, --def=file
Generate an export file named lib.exe containing the export definitions contained in export file file.
-c
Suppress the diagnostic message that is written to standard error when the archive file lib is created.
-I
Generate and add import symbols for extern data symbols.
-l
This option is ignored
-q
This option is ignored.
-s
This option is ignored.
-u
When used with the -r option, files in the archive will be replaced only if the modification time is at least as new as the modification time of the file in lib.
-v, --verbose
When used with -t the table of contents is in ls -l format. When used with -d, -r, or -x, a more detailed description of the maintenance activity is reported.

EXIT STATUS

0
No errors occurred.
>0
One or more errors occurred.

SEE ALSO

ls(1), ld(1), pax(1)

IMPLEMENTATION

version
ar (AT&T Labs Research) 2004-07-06
author
David Korn <dgk@research.att.com>
copyright
Copyright © 1997-2010 AT&T Intellectual Property
license
http://www.opensource.org/licenses/cpl1.0.txt