This directory of Linux commands is from Linux in a Nutshell, 5th Edition.
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
Buy it now, or read it online on Safari Bookshelf.
ar key [args] [posname] [count] archive [files]
Maintain a group of files that are combined into a file archive. Used most commonly to create and update static library files, as used by the link editor (ld). Compiler frontends often call ar automatically. Only one key letter may be used, but each can be combined with additional args (with no separations between). posname is the name of a file in archive. When moving or replacing files, you can specify that they be placed before or after posname. ar has largely been superseded by tar and bzip2.
Delete files from archive.
Move files to end of archive.
Print files in archive.
Append files to archive.
Replace files in archive.
List the contents of archive or list the named files.
Extract contents from archive or only the named files.
Use with r or m key to place files in the archive after posname.
Same as a, but before posname.
Create archive silently.
Truncate long filenames.
Same as b.
For backward compatibility; meaningless in Linux.
Use count parameter. Where multiple entries with the same name are found, use the count instance.
Preserve original timestamps.
Use full pathname. Useful for non-POSIX-compliant archives.
Force regeneration of archive symbol table (useful after running strip).
Do not regenerate symbol table.
Use with r to replace only files that have changed since being put in archive.
Verbose; print a description of actions taken.
Print version number.
Replace mylib.a with object files from the current directory:
ar r mylib.a `ls *.o`