2016-05-10 10:01:53 -07:00
|
|
|
# cpio
|
|
|
|
|
2024-04-25 19:58:21 -03: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 10:01:53 -07:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Take a list of file names from `stdin` and add them onto an archive (copy-[o]ut) in cpio's binary forma:
|
2016-05-10 10:01:53 -07:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`echo "{{path/to/file1 path/to/file2 ...}}" | cpio {{[-o|--create]}} > {{archive.cpio}}`
|
2016-05-10 10:01:53 -07:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Copy all files and directories in a directory and add them onto an archive (copy-[o]ut), in verbose mode:
|
2016-05-10 10:01:53 -07:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`find {{path/to/directory}} | cpio {{[-ov|--create --verbose]}} > {{archive.cpio}}`
|
2016-05-10 10:01:53 -07:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Pick all files from an archive (copy-[i]n), generating directories where needed, in verbose mode:
|
2016-05-10 10:01:53 -07:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`cpio {{[-idv|--extract --make-directories --verbose]}} < {{archive.cpio}}`
|