tldr/pages/common/cpio.md

17 lines
620 B
Markdown
Raw Normal View History

2016-05-10 18:01:53 +01:00
# cpio
> Copies files in and out of archives.
> Supports following archive formats: binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar.
2016-05-10 18:01:53 +01:00
- Take a list of file names from standard input and copy them [o]ut to an archive in binary format:
2016-05-10 18:01:53 +01:00
`echo "{{file1}} {{file2}} {{file3}}" | cpio -o > {{archive.cpio}}`
2016-05-10 18:01:53 +01:00
- Copy [o]ut all files and folders in a directory to an archive, in [v]erbose mode:
2016-05-10 18:01:53 +01:00
`find {{path/to/directory}} | cpio -ov > {{archive.cpio}}`
2016-05-10 18:01:53 +01:00
- Copy [i]n all files from an archive, generating [d]irectories where needed, in [v]erbose mode:
2016-05-10 18:01:53 +01:00
`cpio -idv < {{archive.cpio}}`