tldr/pages/common/cpio.md

16 lines
499 B
Markdown
Raw Normal View History

2016-05-10 18:01:53 +01:00
# cpio
> Copies files to and from archives.
2016-05-10 18:01:53 +01:00
- Take a list of file names from standard input and creates an archive from them:
2016-05-10 18:01:53 +01:00
`echo "{{file1}} {{file2}} {{file3}}" | cpio -o > {{[o]utput_archive.cpio}}`
2016-05-10 18:01:53 +01:00
- Create an archive containing all the files and folders in a directory in [v]erbose mode:
2016-05-10 18:01:53 +01:00
`find {{path/to/directory}} | cpio -ov > {{[o]utput_archive.cpio}}`
2016-05-10 18:01:53 +01:00
- Extract files from an archive, generating [d]irectories where needed, in [v]erbose mode:
2016-05-10 18:01:53 +01:00
`cpio -idv < {{[i]nput_archive.cpio}}`