cpio â copy files to and from archives
| Use Case | Command | Description |
|---|---|---|
| đ§ Create an archive | find . -type f | cpio -o > archive.cpio |
Read file list from stdin, write archive to stdout |
| đĻ Extract an archive | cpio -i < archive.cpio |
Read archive from stdin, extract files |
| đ List archive contents | cpio -it < archive.cpio |
List files without extracting |
| đī¸ Create compressed archive | find . | cpio -o | gzip > archive.cpio.gz |
Combine with gzip for compression |
| đ Extract from compressed archive | zcat archive.cpio.gz | cpio -i |
Use zcat to decompress on the fly |
| đ Copy directory tree | find . -depth | cpio -p /destination |
Pass-through mode copies files to another directory |
cpio {-o|--create} [-0acvABLV] [-C BYTES] [-H FORMAT] [-M MESSAGE] [-O [[USER@]HOST:]ARCHIVE]
[-F [[USER@]HOST:]ARCHIVE] [--file=[[USER@]HOST:]ARCHIVE] [--format=FORMAT] [--message=MESâ
SAGE] [--null] [--reset-access-time] [--verbose] [--dot] [--append] [--block-size=blocks]
[--dereference] [--io-size=BYTES] [--quiet] [--force-local] [--rsh-command=COMMAND] < name-
list [> archive]
cpio {-i|--extract} [-bcdfmnrtsuvBSV] [-C BYTES] [-E FILE] [-H FORMAT] [-M MESSAGE] [-R
[USER][:.][GROUP]] [-I [[USER@]HOST:]ARCHIVE] [-F [[USER@]HOST:]ARCHIVE]
[--file=[[USER@]HOST:]ARCHIVE] [--make-directories] [--nonmatching] [--preserve-modificaâ
tion-time] [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--dot] [--unconâ
ditional] [--verbose] [--block-size=BLOCKS] [--swap-halfwords] [--io-size=BYTES] [--patâ
tern-file=FILE] [--format=FORMAT] [--owner=[USER][:.][GROUP]] [--no-preserve-owner] [--mesâ
sage=MESSAGE] [--force-local] [--no-absolute-filenames] [--sparse] [--only-verify-crc]
[--to-stdout] [--quiet] [--rsh-command=COMMAND] [pattern...] [< archive]
cpio {-p|--pass-through} [-0adlmuvLV] [-R [USER][:.][GROUP]] [--null] [--reset-access-time]
[--make-directories] [--link] [--quiet] [--preserve-modification-time] [--unconditional]
[--verbose] [--dot] [--dereference] [--owner=[USER][:.][GROUP]] [--no-preserve-owner]
[--sparse] destination-directory < name-list
cpio {-?|--help|--usage|--version}
GNU cpio copies files between archives and directories. It supports the following archive formats: old binary cpio, old portable cpio, SVR4 cpio with and without checksum, HP cpio, and various tar formats.
The operation mode is requested by one of the following options:
Read a list of file names from the standard input and create on the standard output (unless overridden by the --file option) an archive containing these files.
Read the archive from standard input (or from the file supplied with the --file option) and extract files from it, or (if the -t option is given) list its contents to the standard output. If one or more patterns are supplied, read or list only files matching these patterns. The -t option alone implies -i.
Read a list of file names from the standard input and copy them to the specified directory.
Give a short help summary and exit.
Print a short usage message and exit.
Print program version and exit.
GNU cpio exits with code 0 if it was able to successfully complete the requested operation. On errors, it exits with code 2.
Report cpio bugs to bug-cpio AT gnu.org
GNU cpio home page: http://www.gnu.org/software/cpio/
General help using GNU software: http://www.gnu.org/gethelp/
Report cpio translation bugs to http://translationproject.org/team/
Copyright Š 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
```Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-04 14:28 @216.73.216.128
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)