tldr/pages/common/ar.md

24 lines
484 B
Markdown
Raw Normal View History

2015-10-22 10:31:52 +03:00
# ar
2014-03-10 19:31:07 +04:00
2016-09-29 15:31:04 +03:00
> Create, modify, and extract from archives (.a, .so, .o).
2014-03-10 19:31:07 +04:00
- Extract all members from an archive:
2014-03-10 19:31:07 +04:00
2015-12-31 01:05:57 +03:00
`ar -x {{libfoo.a}}`
2014-03-10 19:31:07 +04:00
- List the members of an archive:
2014-03-10 19:31:07 +04:00
2015-12-31 01:05:57 +03:00
`ar -t {{libfoo.a}}`
- Replace or add files to an archive:
2015-12-31 01:05:57 +03:00
`ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`
- Insert an object file index (equivalent to using `ranlib`):
2015-12-31 01:05:57 +03:00
`ar -s {{libfoo.a}}`
- Create an archive with files and an accompanying object file index:
2015-12-31 01:05:57 +03:00
`ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`