CPIO(1) GNU CPIO CPIO(1)
cpio - copy files to and from archives
| Use Case | Command | Description |
|---|---|---|
| Create archive | cpio -o < file-list > archive.cpio | đĻ Create an archive from a list of files |
| Extract archive | cpio -i < archive.cpio | đ Extract files from an archive |
| List archive contents | cpio -it < archive.cpio | đ List files in an archive |
| Pass-through copy | cpio -p target-dir < file-list | đ Copy files to a directory |
| Create tar format | cpio -o -H tar < file-list > archive.tar | đĻ Create a tar archive |
| Extract with directories | cpio -idm < archive.cpio | đ Extract preserving directories and modification times |
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=MESSAGE] [--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-modification-time] [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--dot] [--unconditional] [--verbose] [--block-size=BLOCKS] [--swap-halfwords] [--io-size=BYTES] [--pattern-file=FILE] [--format=FORMAT] [--owner=[USER][:.][GROUP]] [--no-preserve-owner] [--message=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.
--block-size=BLOCK-SIZE â Set the I/O block size to BLOCK-SIZE * 512 bytes.-B â Set the I/O block size to 5120 bytes.-c â Use the old portable (ASCII) archive format. Same as -H odc.-C, --io-size=NUMBER â Set the I/O block size to the given NUMBER of bytes.-D, --directory=DIR â Change to directory DIR.--force-local â Archive file is local, even if its name contains colons.-H, --format=FORMAT â Use given archive FORMAT. Valid formats: bin (obsolete binary), odc (old POSIX.1 portable), newc (new SVR4 portable), crc (new SVR4 with checksum), tar (old tar), ustar (POSIX.1 tar), hpbin (HPUX binary), hpodc (HPUX portable).-R, --owner=[USER][:.][GROUP] â Set ownership of all files created. In copy-out mode, store owner information in archive.--quiet â Do not print the number of blocks copied at the end.--rsh-command=COMMAND â Use remote COMMAND instead of rsh.-v, --verbose â Verbosely list the files processed.-V, --dot â Print a "." for each file processed.-W, --warning=FLAG â Control warning display. FLAG: none, all, truncate, no-truncate. Multiple -W options accumulate.-F, --file=[[USER@]HOST:]ARCHIVE-FILE â Use this ARCHIVE-FILE instead of standard input/output.-M, --message=STRING â Print STRING when end of volume reached.-b, --swap â Swap both halfwords of words and bytes of halfwords. Equivalent to -sS.-f, --nonmatching â Only copy files that do not match any of the given patterns.-n, --numeric-uid-gid â Show numeric UID and GID in verbose listing.-r, --rename â Interactively rename files.-s, --swap-bytes â Swap the bytes of each halfword.-S, --swap-halfwords â Swap the halfwords of each word (4 bytes).--to-stdout â Extract files to standard output.-E, --pattern-file=FILE â Read additional patterns from FILE.--only-verify-crc â Only verify CRC's, without extracting files.-A, --append â Append to an existing archive.--device-independent, --reproducible â Create reproducible archives. Equivalent to --ignore-devno --renumber-inodes.--ignore-devno â Store 0 in device number field.-O [[USER@]HOST:]ARCHIVE-NAME â Use ARCHIVE-NAME instead of standard output.--renumber-inodes â Renumber inodes when storing.-l, --link â Link files instead of copying when possible.--absolute-filenames â Do not strip file system prefix components. This is the default.--no-absolute-filenames â Create all files relative to the current directory.-0, --null â Filenames are delimited by null characters instead of newlines.-a, --reset-access-time â Reset access times of files after reading them.-I [[USER@]HOST:]ARCHIVE-NAME â Use ARCHIVE-NAME instead of standard input.-L, --dereference â Dereference symbolic links (copy target files).-d, --make-directories â Create leading directories where needed.-m, --preserve-modification-time â Retain previous file modification times.--no-preserve-owner â Do not change ownership of files.--sparse â Write files with large blocks of zeros as sparse files.-u, --unconditional â Replace all files unconditionally.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.
CPIO June 21, 2018 CPIO(1)
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-26 08:57 @216.73.217.127
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)