2016-05-10 18:01:53 +01:00
|
|
|
# cpio
|
|
|
|
|
2024-04-25 23:58:21 +01:00
|
|
|
> Copy files in and out of archives.
|
2016-09-14 23:30:06 +01:00
|
|
|
> Supports the following archive formats: cpio's custom binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar.
|
2019-06-09 00:05:29 +01:00
|
|
|
> More information: <https://www.gnu.org/software/cpio>.
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2023-08-09 06:29:02 +01:00
|
|
|
- Take a list of file names from `stdin` and add them [o]nto an archive in cpio's binary format:
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
`echo "{{path/to/file1 path/to/file2 ...}}" | cpio -o > {{archive.cpio}}`
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2019-02-08 00:28:43 +00:00
|
|
|
- Copy all files and directories in a directory and add them [o]nto an archive, in [v]erbose mode:
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-13 07:35:19 +01:00
|
|
|
`find {{path/to/directory}} | cpio -ov > {{archive.cpio}}`
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-14 17:48:01 +01:00
|
|
|
- P[i]ck all files from an archive, generating [d]irectories where needed, in [v]erbose mode:
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-13 07:35:19 +01:00
|
|
|
`cpio -idv < {{archive.cpio}}`
|