The archiver, also known simply as ar, is a Unix utility that maintains groups of files as a single archive file. Today, ar is generally used only to create and update static library files that the link editor or linker uses and for generating .deb packages for the Debian family; it can be used to create archives for any purpose, but has been largely replaced by tar for purposes other than static libraries. An implementation of ar is included as one of the GNU Binutils.
In the Linux Standard Base, ar has been deprecated and is expected to disappear in a future release of that Standard. The rationale provided was that "the LSB does not include software development utilities nor does it specify .o and .a file formats."
The ar format has never been standardized; modern archives are based on a common format with two main variants, BSD and System V (initially known as COFF, and used as well by GNU, ELF, and Windows.)
Historically there have been other variants including V6, V7, AIX (small and big), and Coherent, which all vary significantly from the common format.
Debian ".deb" archives use the common format.
An ar file begins with a global header, followed by a header and data section for each file stored within the ar file.
Each data section is 2 byte aligned. If it would end on an odd offset, a newline ('\n', 0x0A) is used as filler.
The file signature is a single field containing the magic ASCII string "!<arch>"
followed by a single LF control character (0x0A).