📄 ar.1
字号:
.\" Copyright (c) 1990, 1993.\" The Regents of the University of California. All rights reserved..\".\" This code is derived from software contributed to Berkeley by.\" Hugh Smith at The University of Guelph..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)ar.1 8.1 (Berkeley) 6/29/93.\".TH AR 1 "June 29, 1993".AT 3.SH NAMEar \- create and maintain library archives.SH SYNOPSIS.nf.ft Bar -d [-Tv] archive file ...ar -m [-Tv] archive file ...ar -m [-abiTv] position archive file ...ar -p [-Tv] archive [file ...]ar -q [-cTv] archive file ...ar -r [-cuTv] archive file ...ar -r [-abciuTv] position archive file ...ar -t [-Tv] archive [file ...]ar -x [-ouTv] archive [file ...].fi.ft R.SH DESCRIPTIONThe.I arutility creates and maintains groups of files combined into an archive.Once an archive has been created, new files can be added and existingfiles can be extracted, deleted, or replaced..PPFiles are named in the archive by a single component, i.e., if a filereferenced by a path containing a slash (``/'') is archived it will benamed by the last component of that path.When matching paths listed on the command line against file names storedin the archive, only the last component of the path will be compared..PPAll informational and error messages use the path listed on the commandline, if any was specified; otherwise the name in the archive is used.If multiple files in the archive have the same name, and paths are listedon the command line to ``select'' archive files for an operation, only the.B firstfile with a matching name will be selected..PPThe normal use of.I aris for the creation and maintenance of libraries suitable for use withthe loader (see.IR ld (1)),although it is not restricted to this purpose.The options are as follows:.TP\-aA positioning modifier used with the options \-r and \-m.The files are entered or moved.B afterthe archive member.IR position ,which must be specified..TP\-bA positioning modifier used with the options \-r and \-m.The files are entered or moved.B beforethe archive member.IR position ,which must be specified..TP\-cWhenever an archive is created, an informational message to that effectis written to standard error.If the \-c option is specified,.I arcreates the archive silently..TP\-dDelete the specified archive files..TP\-iIdentical to the \-b option..TP\-mMove the specified archive files within the archive.If one of the options \-a, \-b or \-i is specified, the files are movedbefore or after the.I positionfile in the archive.If none of those options are specified, the files are movedto the end of the archive..TP\-oSet the access and modification times of extracted files to themodification time of the file when it was entered into the archive.This will fail if the user is not the owner of the extracted fileor the super-user..TP\-pWrite the contents of the specified archive files to the standard output.If no files are specified, the contents of all the files in the archiveare written in the order they appear in the archive..TP\-q(Quickly) append the specified files to the archive.If the archive does not exist a new archive file is created.Much faster than the \-r option, when creating a large archivepiece-by-piece, as no checking is done to see if the files alreadyexist in the archive..TP\-rReplace or add the specified files to the archive.If the archive does not exist a new archive file is created.Files that replace existing files do not change the order of the fileswithin the archive.New files are appended to the archive unless one of the options \-a, \-bor \-i is specified..TP\-TSelect and/or name archive members using only the first fifteen charactersof the archive member or command line file name.The historic archive format had sixteen bytes for the name, but somehistoric archiver and loader implementations were unable to handle namesthat used the entire space.This means that file names that are not unique in their first fifteencharacters can subsequently be confused.A warning message is printed to the standard error output if any filenames are truncated.(See.IR ar (5)for more information.).TP\-tList the specified files in the order in which they appear in the archive,each on a separate line.If no files are specified, all files in the archive are listed..TP\-uUpdate files.When used with the \-r option, files in the archive will be replacedonly if the disk file has a newer modification time than the file inthe archive.When used with the \-x option, files in the archive will be extractedonly if the archive file has a newer modification time than the fileon disk..TP\-vProvide verbose output.When used with the \-d, \-m, \-q or \-x options,.I argives a file-by-file description of the archive modification.This description consists of three, white-space separated fields: theoption letter, a dash (``-'') and the file name.When used with the \-r option,.I ardisplays the description as above, but the initial letter is an ``a'' ifthe file is added to the archive and an ``r'' if the file replaces a filealready in the archive..IPWhen used with the \-p option,the name of each printed file,enclosed in less-than (``<'') and greater-than (``>'') characters,is written to the standard output beforethe contents of the file;it is preceded by a single newline character, andfollowed by two newline characters..IPWhen used with the \-t option,.I ardisplays an ``ls -l'' style listing of information about the members ofthe archive.This listing consists of eight, white-space separated fields:the file permissions (see.IR strmode (3)),the decimal user and group ID's separated by a single slash (``/''),the file size (in bytes), the file modification time (in the.IR date (1)format ``%b %e %H:%M %Y''), and the name of the file..TP\-xExtract the specified archive members into the files named by the commandline arguments.If no members are specified, all the members of the archive are extracted intothe current directory..IPIf the file does not exist, it is created; if it does exist, the ownerand group will be unchanged.The file access and modification times are the time of the extraction(but see the \-o option).The file permissions will be set to those of the file when it was enteredinto the archive; this will fail if the user is not the owner of theextracted file or the super-user..PPThe.I arutility exits 0 on success, and >0 if an error occurs..SH ENVIRONMENT.TPTMPDIRThe pathname of the directory to use when creating temporary files..SH FILES.TP 14/tmpdefault temporary file directory.TP 14ar.XXXXXXtemporary file names.SH COMPATIBILITYBy default,.I arwrites archives that may be incompatible with historic archives, asthe format used for storing archive members with names longer thanfifteen characters has changed.This implementation of.I aris backward compatible with previous versions of.I arin that it can read and write (using the \-T option) historic archives.The \-T option is provided for compatibility only, and will be deletedin a future release.See.IR ar (5)for more information..SH STANDARDSThe.I arutility is expected to offer a superset of the POSIX 1003.2 functionality..SH "SEE ALSO"ld(1), ranlib(1), strmode(3), ar(5)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -