📄 ar.1
字号:
.\" Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999, 2000 Free Software Foundation.\" See section COPYING for conditions for redistribution.TH ar 1 "1999" "Free Software Foundation" "GNU Development Tools".de BP.sp.ti \-.2i\(**...SH NAMEar \- create, modify, and extract from archives..SH SYNOPSIS.hy 0.na.BR ar " [\|" "-" "\|]"\c.I {dmpqrtx}[abcfilNoPsSuvV] \c[\|\c.I membername\c\&\|] \c[\|\c.I count\c\&\|] \c.I archive\c\& \c.I files\c\&.\|.\|..ad b.hy 1.SH DESCRIPTIONThe GNU \c.B ar\c\& program creates, modifies, and extracts fromarchives. An \c.I archive\c\& is a single file holding a collection ofother files in a structure that makes it possible to retrievethe original individual files (called \c.I members\c\& of the archive).The original files' contents, mode (permissions), timestamp, owner, andgroup are preserved in the archive, and may be reconstituted onextraction. GNU \c.B ar\c\& can maintain archives whose members have names of anylength; however, depending on how \c.B ar\c\& is configured on yoursystem, a limit on member-name length may be imposed (for compatibilitywith archive formats maintained with other tools). If it exists, thelimit is often 15 characters (typical of formats related to a.out) or 16characters (typical of formats related to coff).\c.B ar\c\& is considered a binary utility because archives of this sortare most often used as \c.I libraries\c\& holding commonly neededsubroutines.\c.B ar\c\& will create an index to the symbols defined in relocatableobject modules in the archive when you specify the modifier `\|\c.B s\c\|'.Once created, this index is updated in the archive whenever \c.B ar\c\&makes a change to its contents (save for the `\|\c.B q\c\|' update operation).An archive with such an index speeds up linking to the library, andallows routines in the library to call each other without regard totheir placement in the archive.You may use `\|\c.B nm \-s\c\|' or `\|\c.B nm \-\-print\-armap\c\|' to list this indextable. If an archive lacks the table, another form of \c.B ar\c\& called\c.B ranlib\c\& can be used to add just the table.\c.B ar\c\& insists on at least two arguments to execute: onekeyletter specifying the \c.I operation\c\& (optionally accompanied by otherkeyletters specifying \c.I modifiers\c\&), and the archive name to act on.Most operations can also accept further \c.I files\c\& arguments,specifying particular files to operate on..SH OPTIONSGNU \c.B ar\c\& allows you to mix the operation code \c.I p\c\& and modifierflags \c.I mod\c\& in any order, within the first command-line argument.If you wish, you may begin the first command-line argument with adash.The \c.I p\c\& keyletter specifies what operation to execute; it may beany of the following, but you must specify only one of them:.TP.B d\c.I Delete\c\& modules from the archive. Specify the names of modules tobe deleted as \c.I files\c\&; the archive is untouched if youspecify no files to delete.If you specify the `\|\c.B v\c\|' modifier, \c.B ar\c\& will list each moduleas it is deleted..TP.B mUse this operation to \c.I move\c\& members in an archive.The ordering of members in an archive can make a difference in howprograms are linked using the library, if a symbol is defined in morethan one member. If no modifiers are used with \c.B m\c\&, any members you name in the\c.I files\c\& arguments are moved to the \c.I end\c\& of the archive;you can use the `\|\c.B a\c\|', `\|\c.B b\c\|', or `\|\c.B i\c\|' modifiers to move them to aspecified place instead..TP.B p\c.I Print\c\& the specified members of the archive, to the standardoutput file. If the `\|\c.B v\c\|' modifier is specified, show the membername before copying its contents to standard output.If you specify no \c.I files\c\&, all the files in the archive are printed..TP.B q\c.I Quick append\c\&; add \c.I files\c\& to the end of \c.I archive\c\&,without checking for replacement. The modifiers `\|\c.B a\c\|', `\|\c.B b\c\|', and `\|\c.B i\c\|' do \c.I not\c\& affect thisoperation; new members are always placed at the end of the archive.The modifier `\|\c.B v\c\|' makes \c.B ar\c\& list each file as it is appended.Since the point of this operation is speed, the archive's symbol tableindex is not updated, even if it already existed; you can use `\|\c.B ar s\c\|' or\c.B ranlib\c\& explicitly to update the symbol table index.However, too many different systems assume quick append rebuilds theindex, so GNU.B arimplements `\|\c.B q\c\|' as a synonym for `\|\c.B r\c\|'..TP.B rInsert \c.I files\c\& into \c.I archive\c\& (with \c.I replacement\c\&). Thisoperation differs from `\|\c.B q\c\|' in that any previously existing membersare deleted if their names match those being added.If one of the files named in \c.I files\c\& doesn't exist, \c.B ar\c\&displays an error message, and leaves undisturbed any existing membersof the archive matching that name.By default, new members are added at the end of the file; but you mayuse one of the modifiers `\|\c.B a\c\|', `\|\c.B b\c\|', or `\|\c.B i\c\|' to requestplacement relative to some existing member.The modifier `\|\c.B v\c\|' used with this operation elicits a line ofoutput for each file inserted, along with one of the letters `\|\c.B a\c\|' or`\|\c.B r\c\|' to indicate whether the file was appended (no old memberdeleted) or replaced..TP.B tDisplay a \c.I table\c\& listing the contents of \c.I archive\c\&, or thoseof the files listed in \c.I files\c\& that are present in thearchive. Normally only the member name is shown; if you also want tosee the modes (permissions), timestamp, owner, group, and size, you canrequest that by also specifying the `\|\c.B v\c\|' modifier.If you do not specify any \c.I files\c\&, all files in the archiveare listed.If there is more than one file with the same name (say, `\|\c.B fie\c\|') inan archive (say `\|\c.B b.a\c\|'), `\|\c.B ar t b.a fie\c\|' will list only thefirst instance; to see them all, you must ask for a completelisting\(em\&in our example, `\|\c.B ar t b.a\c\|'..TP.B x\c.I Extract\c\& members (named \c.I files\c\&) from the archive. You canuse the `\|\c.B v\c\|' modifier with this operation, to request that\c.B ar\c\& list each name as it extracts it.If you do not specify any \c.I files\c\&, all files in the archiveare extracted..PPA number of modifiers (\c.I mod\c\&) may immediately follow the \c.I p\c\&keyletter, to specify variations on an operation's behavior:.TP.B aAdd new files \c.I after\c\& an existing member of thearchive. If you use the modifier \c.B a\c\&, the name of an existing archivemember must be present as the \c.I membername\c\& argument, before the\c.I archive\c\& specification..TP.B bAdd new files \c.I before\c\& an existing member of thearchive. If you use the modifier \c.B b\c\&, the name of an existing archivemember must be present as the \c.I membername\c\& argument, before the\c.I archive\c\& specification. (same as `\|\c.B i\c\|')..TP.B c\c.I Create\c\& the archive. The specified \c.I archive\c\& is alwayscreated if it didn't exist, when you request an update. But a warning isissued unless you specify in advance that you expect to create it, byusing this modifier..TP.B fTruncate names in the archive. .B arwill normally permit file names of any length. This will cause it tocreate archives which are not compatible with the native .B arprogram on some systems. If this is a concern, the .B fmodifier may be used to truncate file names when putting them in thearchive..TP.B iInsert new files \c.I before\c\& an existing member of thearchive. If you use the modifier \c.B i\c\&, the name of an existing archivemember must be present as the \c.I membername\c\& argument, before the\c.I archive\c\& specification. (same as `\|\c.B b\c\|')..TP.B lThis modifier is accepted but not used..TP.B NUses the.I countparameter. This is used if there are multiple entries in the archivewith the same name. Extract or delete instance.I countof the given name from the archive..TP.B oPreserve the \c.I original\c\& dates of members when extracting them. Ifyou do not specify this modifier, files extracted from the archivewill be stamped with the time of extraction..TP.B PUse the full path name when matching names in the archive..B arcan not create an archive with a full path name (such archives are notPOSIX complaint), but other archive creators can. This option willcause.B arto match file names using a complete path name, which can beconvenient when extracting a single file from an archive created byanother tool..TP.B sWrite an object-file index into the archive, or update an existing one,even if no other change is made to the archive. You may use this modifierflag either with any operation, or alone. Running `\|\c.B ar s\c\|' on an
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -