1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/ar.md

25 lines
585 B
Markdown
Raw Normal View History

2015-10-22 15:31:52 +08:00
# ar
2014-03-10 16:31:07 +01:00
> Create, modify, and extract from archives (`.a`, `.so`, `.o`).
> More information: <https://manned.org/ar>.
2014-03-10 16:31:07 +01:00
- Extract all members from an archive:
2014-03-10 16:31:07 +01:00
`ar -x {{path/to/file.a}}`
2014-03-10 16:31:07 +01:00
- List the members of an archive:
2014-03-10 16:31:07 +01:00
2021-03-31 12:45:23 -03:00
`ar -t {{path/to/file.a}}`
2015-12-30 15:05:57 -07:00
- Replace or add files to an archive:
2015-12-30 15:05:57 -07:00
`ar -r {{path/to/file.a}} {{path/to/file1.o}} {{path/to/file2.o}}`
2015-12-30 15:05:57 -07:00
- Insert an object file index (equivalent to using `ranlib`):
2015-12-30 15:05:57 -07:00
2021-03-31 12:45:23 -03:00
`ar -s {{path/to/file.a}}`
2015-12-30 15:05:57 -07:00
- Create an archive with files and an accompanying object file index:
2015-12-30 15:05:57 -07:00
`ar -rs {{path/to/file.a}} {{path/to/file1.o}} {{path/to/file2.o}}`