2016-05-10 18:01:53 +01:00
|
|
|
# cpio
|
|
|
|
|
2016-09-07 19:12:01 +01:00
|
|
|
> Copies files to and from archives.
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-07 19:12:01 +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
|
|
|
|
2016-09-07 19:12:01 +01:00
|
|
|
`echo "{{file1}} {{file2}} {{file3}}" | cpio -o > {{[o]utput_archive.cpio}}`
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-07 19:12:01 +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
|
|
|
|
2016-09-07 19:12:01 +01:00
|
|
|
`find {{path/to/directory}} | cpio -ov > {{[o]utput_archive.cpio}}`
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-07 19:12:01 +01:00
|
|
|
- Extract files from an archive, generating [d]irectories where needed, in [v]erbose mode:
|
2016-05-10 18:01:53 +01:00
|
|
|
|
2016-09-07 19:12:01 +01:00
|
|
|
`cpio -idv < {{[i]nput_archive.cpio}}`
|