2015-10-22 08:31:52 +01:00
|
|
|
# ar
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
> Create, modify, and extract from Unix archives. Typically used for static libraries (`.a`) and Debian packages (`.deb`).
|
|
|
|
> See also: `tar`.
|
2021-04-12 07:54:04 +01:00
|
|
|
> More information: <https://manned.org/ar>.
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
- E[x]tract all members from an archive:
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
`ar x {{path/to/file.a}}`
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
- Lis[t] contents in a specific archive:
|
2014-03-10 15:31:07 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
`ar t {{path/to/file.ar}}`
|
2015-12-30 22:05:57 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
- [r]eplace or add specific files to an archive:
|
2015-12-30 22:05:57 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
`ar r {{path/to/file.deb}} {{path/to/debian-binary path/to/control.tar.gz path/to/data.tar.xz ...}}`
|
2015-12-30 22:05:57 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
- In[s]ert an object file index (equivalent to using `ranlib`):
|
2015-12-30 22:05:57 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
`ar s {{path/to/file.a}}`
|
2015-12-30 22:05:57 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
- Create an archive with specific files and an accompanying object file index:
|
2015-12-30 22:05:57 +00:00
|
|
|
|
2022-12-20 09:27:15 +00:00
|
|
|
`ar rs {{path/to/file.a}} {{path/to/file1.o path/to/file2.o ...}}`
|