CPIO(1)
๐ซ CPIO(1) โ the GNU CPIO era ๐ซ
okay bestie, so this is the GNU CPIO manual page and honestly? it's a whole vibe. cpio copies files to and from archives, and once you get it, you get it. iykyk ๐
โจ NAME โจ
cpio โ copy files to and from archives ๐ฆ
โจ SYNOPSIS โจ
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}
like, four whole modes, pick your fighter ๐
โ ๏ธ NOTE โ ๏ธ
bestie this manpage is literally just the short version of GNU cpio. for the full tea โ examples, usage recommendations, all of it โ go read the GNU Cpio Manual in texinfo format. if the info reader and the cpio docs are properly installed on your system, this command:
info cpio
should give you access to the complete manual. ๐ซถ
you can also view the manual using the info mode in emacs(1), or find it in various formats online at:
http://www.gnu.org/software/cpio/manual
if any discrepancies occur between this manpage and the GNU Cpio Manual, the later shall be considered the authoritative source. no cap, the manual wins. ๐
๐ธ DESCRIPTION ๐ธ
GNU cpio copies files between archives and directories. it supports these archive formats, and yes it's giving range: old binary cpio, old portable cpio, SVR4 cpio with and without checksum, HP cpio, and various tar formats. iconic behavior honestly. ๐
the operation mode is requested by one of the following options:
-o,--createโ Copy-out. read a list of file names from the standard input and create on the standard output (unless overridden by the--fileoption) an archive containing these files. main character energy: it's making the archive โจ-i,--extractโ Copy-in. read the archive from standard input (or from the file supplied with the--fileoption) and extract files from it, or (if the-toption is given) list its contents to the standard output. if one or more patterns are supplied, read or list only files matching these patterns. and psst โ the-toption alone implies-i. ๐-p,--pass-throughโ Pass-through. read a list of file names from the standard input and copy them to the specified directory. no archive, just vibes and files moving. ๐ฆ-?,--helpโ give a short help summary and exit. a little snack of information ๐--usageโ print a short usage message and exit.--versionโ print program version and exit.
๐ OPTIONS ๐
๐ง Operation modifiers valid in any mode
--block-size=BLOCK-SIZEโ set the I/O block size toBLOCK-SIZE* 512 bytes.-Bโ set the I/O block size to 5120 bytes.-cโ use the old portable (ASCII) archive format. this is the same as-H odc.-C,--io-size=NUMBERโ set the I/O block size to the givenNUMBERof bytes.-D,--directory=DIRโ change to directoryDIR.--force-localโ archive file is local, even if its name contains colons. local is local, periodt.-H,--format=FORMATโ use given archiveFORMAT. valid formats are (the number in parentheses gives maximum size for individual archive member):binโ the obsolete binary format. (2147483647 bytes)odcโ the old (POSIX.1) portable format. (8589934591 bytes)newcโ the new (SVR4) portable format, which supports file systems having more than 65536 inodes. (4294967295 bytes)crcโ the new (SVR4) portable format with a checksum added.tarโ the old tar format. (8589934591 bytes)ustarโ the POSIX.1 tar format. also recognizes GNU tar archives, which are similar but not identical. (8589934591 bytes)hpbinโ the obsolete binary format used by HPUX's cpio (which stores device files differently).hpodcโ the portable format used by HPUX's cpio (which stores device files differently).
-R,--owner=[USER][:.][GROUP]โ in copy-in and copy-pass mode, set the ownership of all files created to the specifiedUSERand/orGROUP. in copy-out mode, store the supplied owner information in the archive.USERandGROUPare first looked up in the system user and group databases. if not found, cpio checks if they consist of decimal digits only and, if so, treats them as numeric UID and GID, correspondingly. to avoid the lookup and ensure that arguments are treated as numeric values, prefix them with a plus sign, e.g.:-R +0:+0. ๐--quietโ do not print the number of blocks copied at the end of the run. shhh ๐คซ--rsh-command=COMMANDโ use remoteCOMMANDinstead ofrsh.-v,--verboseโ verbosely list the files processed.-V,--dotโ print a "." for each file processed.-W,--warning=FLAGโ controls what warnings are displayed. theFLAGis one ofnone, to disable all warnings,allto enable them,truncate, to enable warnings about field truncation, andno-truncate, to disable them. multiple-Woptions accumulate. ๐ซถ
๐ฆ Operation modifiers valid in copy-in and copy-out modes
-F,--file=[[USER@]HOST:]ARCHIVE-FILEโ use thisARCHIVE-FILEinstead of standard input (in copy-in mode) or standard output (in copy-out mode). optionalUSERandHOSTspecify the user and host names in case of a remote archive.-M,--message=STRINGโ printSTRINGwhen the end of a volume of the backup media is reached. a little heads-up note ๐
โญ Operation modifiers valid only in copy-in mode
-b,--swapโ swap both halfwords of words and bytes of halfwords in the data. equivalent to-sS.-f,--nonmatchingโ only copy files that do not match any of the given patterns. the contrarian option, we love her ๐-n,--numeric-uid-gidโ in the verbose table of contents listing, show numeric UID and GID.-r,--renameโ interactively rename files.-s,--swap-bytesโ swap the bytes of each halfword in the files.-S,--swap-halfwordsโ swap the halfwords of each word (4 bytes) in the files.--to-stdoutโ extract files to standard output.-E,--pattern-file=FILEโ read additional patterns specifying filenames to extract or list fromFILE.--only-verify-crcโ when reading a CRC format archive, only verify the CRC's of each file in the archive, without actually extracting the files. look, don't touch. ๐
๐ฅ Operation modifiers valid only in copy-out mode
-A,--appendโ append to an existing archive.--device-independent,--reproducibleโ create reproducible archives. this is equivalent to--ignore-devno --ignore-dirnlink --renumber-inodes.--ignore-devnoโ store 0 in the device number field of each archive member, instead of the actual device number.--ignore-dirnlinkโ store 2 in the nlink field of each directory archive member, instead of the actual number of links.-O [[USER@]HOST:]ARCHIVE-NAMEโ useARCHIVE-NAMEinstead of standard output. optionalUSERandHOSTspecify the user and host names in case of a remote archive. the output archive name can be specified either using this option, or using-F(--file), but not both. pick one bestie, no double-dipping ๐--renumber-inodesโ renumber inodes when storing them in the archive.
๐ Operation modifiers valid only in copy-pass mode
-l,--linkโ link files instead of copying them, when possible.
๐ Operation modifiers valid in copy-in and copy-out modes
--absolute-filenamesโ do not strip file system prefix components from the file names. this is the default.--no-absolute-filenamesโ create all files relative to the current directory.
๐ Operation modifiers valid in copy-out and copy-pass modes
-0,--nullโ filenames in the list are delimited by null characters instead of newlines.-a,--reset-access-timeโ reset the access times of files after reading them.-I [[USER@]HOST:]ARCHIVE-NAMEโ useARCHIVE-NAMEinstead of standard input. optionalUSERandHOSTspecify the user and host names in case of a remote archive. the input archive name can be specified either using this option, or using-F(--file), but not both. again โ one or the other, not both, i'm serious ๐ญ-L,--dereferenceโ dereference symbolic links (copy the files that they point to instead of copying the links).
๐ Operation modifiers valid in copy-in and copy-pass modes
-d,--make-directoriesโ create leading directories where needed.-m,--preserve-modification-timeโ retain previous file modification times when creating files.--no-preserve-ownerโ do not change the ownership of the files.--sparseโ write files with large blocks of zeros as sparse files.-u,--unconditionalโ replace all files unconditionally. absolutely feral, no questions asked ๐ฅ
๐ RETURN VALUE ๐
GNU cpio exits with code 0 if it was able to successfully complete the requested operation. on errors, it exits with code 2. slay on success, 2 when it's giving chaos. โจ
๐ SEE ALSO ๐
tar(1), rmt(8), mt(1). the whole friend group ๐ซถ
๐ BUG REPORTS ๐
report bugs to <bug-cpio@gnu.org>. tell them everything bestie, they want to know ๐
๐ COPYRIGHT ๐
Copyright ยฉ 2014--2023 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.
fr fr, free software means free to change and share โ but no warranty, so don't come for them if it goes sideways ๐
and that's the whole page diva ๐ โ this little love letter came from GNU CPIO, dated April 29, 2023, and it's out. go archive something iconic. ๐ฆโจ๐
๐ฆ where this page comes from
- alpine 3.24: cpio-doc 2.15-r0 ยท GPL-3.0-or-later
- arch rolling: cpio 2.15-3 ยท GPL-3.0-or-later
- nixos 26.05: cpio 2.15
- nixpkgs unstable: cpio 2.15
- opensuse-leap 16.0: cpio 2.15-160000.3.1 ยท GPL-3.0-only
- opensuse-leap 16.0: cpio 2.15-160000.3.1 ยท GPL-3.0-only
- opensuse-leap 16.0: cpio 2.15-160000.3.1 ยท GPL-3.0-only
- opensuse-leap 16.0: cpio 2.15-160000.3.1 ยท GPL-3.0-only
- Copyright 2014-2024 Free Software Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms