mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-12-26 18:32:41 +03:00
24 lines
484 B
Markdown
24 lines
484 B
Markdown
# ar
|
|
|
|
> Create, modify, and extract from archives (.a, .so, .o).
|
|
|
|
- Extract all members from an archive:
|
|
|
|
`ar -x {{libfoo.a}}`
|
|
|
|
- List the members of an archive:
|
|
|
|
`ar -t {{libfoo.a}}`
|
|
|
|
- Replace or add files to an archive:
|
|
|
|
`ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
|
|
|
|
- Insert an object file index (equivalent to using `ranlib`):
|
|
|
|
`ar -s {{libfoo.a}}`
|
|
|
|
- Create an archive with files and an accompanying object file index:
|
|
|
|
`ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
|