Linux and Unix ar command
Maintain portable archive or library.
ar [-d] [-m] [-p] [-q] [-t] [-x] [-r] [-a] [-b] [-c] [-C] [-F format] [-i] [-l] [-s] [-T] [-I] [-u] [-V] [-v] [ posname ] archive file
|-d||Deletes each named member from the archive and regenerates the symbol table.|
|-m||Moves the named archive member in the archive. You indicate the new position for the member with
|-p||Displays each specified member on the standard output. If you do not specify any members, ar displays all members.|
|-q||Quickly appends the specified file to the archive. ar does not check to see if file is already a member of the archive.|
|-t||Displays a table of contents that lists member or every member if you do not specify a particular member. ar displays a diagnostic
for each member that it cannot find. Normally, ar displays only the member's name, but with the verbose (
|-x||Extracts each specified member from the archive and copies it to a file. If you specify member as a full path name, ar copies it to that path name. If you do not specify a member, ar extracts all members. The archive remains unchanged.|
|-r||Replaces or adds file to archive. If archive does not exist, ar creates it and prints a message. When ar replaces an existing
member, it does not change the archive order. If file is not replacing a member, ar adds it to the end of the archive (unless you specify
|-a||Places file in archive after the member specified by posname. If you do not specify a member, ar adds file to the end of the archive.|
|-b||Places file in archive before the member specified by posname. If you do not specify posname, ar adds file to the beginning of the archive.|
|-c||Suppresses the message ar normally prints when it creates a new archive file. You can only use this in conjunction with the
|-C||Prevents ar from overwriting existing files with extracted files. You can only specify this option when extracting files with the
|-F format||Specifies the archive format to be used by a new archive. Valid formats are omf and coff. You can only use this option
when creating a new archive with the
|-i||Inserts the file into the archive before the member specified by posname. If you do not specify posname, ar inserts file at the
beginning of the archive. This option is the same as
|-I||Ignores the case of letters when searching the archive for specified member names. Normally, the case is significant.|
|-l||Puts any temporary files that ar generates in the current directory rather than the default temporary file directory.|
|-s||Regenerates the symbol table regardless of whether the command modifies the archive.|
|-T||When used with
|-u||Replaces the member only if the modification time of the file member is more recent than the time of the archive member.
|-V||Prints its version number on standard error.|
|-v||Gives verbose output. With
|posname||The name of a file in the archive file, used for relative positioning; see options -m and -r.|
|archive||A path name of the archive file.|
|file||A path name. Only the last component will be used when comparing against the names of files in the archive. If two or more file operands have the same last path name component (basename), the results are unspecified. The implementation's archive format will not truncate valid file names of files added to or replaced in the archive.|
ar r myfile.a 'ls *.o'
Replace myfile.a with object files in the current directory.