PAXCPIO(1)
okay so this is paxcpio(1), from the General Commands Manual, and it's literally all about copying file archives in and out. no cap, it's a whole vibe. let's get into it, bestie π
β¨ NAME β¨
paxcpio β copy file archives in and out
πΈ SYNOPSIS πΈ
paxcpio -o [-0AaBcJjLVvZz] [-C bytes] [-F archive] [-H format] [-M flag]
[-O archive] < name-list [> archive]
paxcpio -i [-06BbcdfJjmrSstuVvZz] [-C bytes] [-E file] [-F archive]
[-H format] [-I archive] [-M flag] [pattern ...] [< archive]
paxcpio -p [-0adLlmuVv] destination-directory < name-list
π¦ DESCRIPTION π¦
The paxcpio command copies files to and from a cpio archive.
The options are as follows:
π
-0 β NUL terminator π
-0β Use the NUL (\0) character as a pathname terminator, instead of newline (\n). this applies only to the pathnames read from standard input in the write and copy modes, and to the pathnames written to standard output in list mode. This option is expected to be used in concert with the-print0function infind(1), the-d ''option to the read built-in utility ofmksh(1)or the-0flag inxargs(1). iykyk, it's giving pipeline energy.
π¦ -o β Create an archive π¦
-oβ Create an archive. Reads the list of files to store in the archive from standard input, and writes the archive on standard output. bestie, this is the glow-up mode.-Aβ Append to the specified archive.-aβ Reset the access times on files that have been copied to the archive.-Bβ Set block size of output to 5120 bytes.-C bytesβ Set the block size of output to bytes.-cβ Use ASCII format for cpio header for portability.-F archiveβ Use the specified file as the input for the archive.-H formatβ Write the archive in the specified format. Recognised formats are:arβ Unix Archiver.bcpioβ Old binary cpio format. Selected by-6.cpioβ Old octal character cpio format. Selected by-c.sv4cpioβ SVR4 hex cpio format.sv4crcβ SVR4 hex cpio format with checksums. This is the default format for creating new archives.tarβ Old tar format.ustarβ POSIX ustar format.binβ These four formats...crcβ ...are supported...newcβ ...for backwards...odcβ ...compatibility only.
-Jβ Use thexzutility to compress the archive.-jβ Use thebzip2utility to compress the archive.-Lβ Follow symbolic links.-M flagβ Configure the archive normaliser. flag is either a numeric value compatible tostrtonum(3)which is directly stored in the flags word, or one of the following values, optionally prefixed with βno-β to turn them off:inodesβ0x0001: Serialise inodes, zero device info. (cpio,sv4cpio,sv4crc)linksβ0x0002: Store content of hard links only once. (cpio,sv4cpio,sv4crc)mtimeβ0x0004: Zero out the file modification time. (ar,cpio,sv4cpio,sv4crc,ustar)uidgidβ0x0008: Set owner to0:0(root:wheel). (ar,cpio,sv4cpio,sv4crc,ustar)verbβ0x0010: Debug this option.debugβ0x0020: Debug file header storage.lncpβ0x0040: Extract hard links by copy if link fails.numidβ0x0080: Use only numeric uid and gid values. (ustar)gslashβ0x0100: Append a slash after directory names. (ustar)setβ0x0003: Keep ownership and mtime intact.distβ0x008B: Clean everything except mtime.normβ0x008F: Clean everything.rootβ0x0089: Clean owner and device information.
When creating an archive and verbosely listing output, these normalisation operations are not reflected in the output, because they are made only after the output has been shown.
This option is only implemented for the ar, cpio, sv4cpio, sv4crc, and ustar file format writing routines.
-O archiveβ Use the specified file name as the archive to write to.-Vβ Print a dot (.) for each file written to the archive.-vβ Be verbose about operations. List filenames as they are written to the archive.-Zβ Use thecompress(1)utility to compress the archive.-zβ Use thegzip(1)utility to compress the archive.
π₯ -i β Restore files from an archive π₯
-iβ Restore files from an archive. Reads the archive file from standard input and extracts files matching the patterns that were specified on the command line. it's giving unarchive and serve.-6β Process old-style cpio format archives.-Bβ Set the block size of the archive being read to 5120 bytes.-bβ Do byte and word swapping after reading in data from the archive, for restoring archives created on systems with a different byte order.-C bytesβ Read archive written with a block size of bytes.-cβ Expect the archive headers to be in ASCII format.-dβ Create any intermediate directories as needed during restore.-E fileβ Read list of file name patterns to extract or list from file.-F archive,-I archiveβ Use the specified file as the input for the archive.-fβ Restore all files except those matching the patterns given on the command line.-H formatβ Read an archive of the specified format. Recognised formats are:arβ Unix Archiver.bcpioβ Old binary cpio format.cpioβ Old octal character cpio format.sv4cpioβ SVR4 hex cpio format.sv4crcβ SVR4 hex cpio format with checksums.tarβ Old tar format.ustarβ POSIX ustar format.binβ These four formats...crcβ ...are supported...newcβ ...for backwards...odcβ ...compatibility only.
-Jβ Use thexzutility to decompress the archive.-jβ Use thebzip2utility to decompress the archive.-mβ Restore modification times on files.-rβ Rename restored files interactively.-Sβ Swap words after reading data from the archive.-sβ Swap bytes after reading data from the archive.-tβ Only list the contents of the archive, no files or directories will be created.-uβ Overwrite files even when the file in the archive is older than the one that will be overwritten.-Vβ Print a dot (.) for each file read from the archive.-vβ Be verbose about operations. List filenames as they are copied in from the archive.-Zβ Use thecompress(1)utility to decompress the archive.-zβ Use thegzip(1)utility to decompress the archive.
π€ -p β Copy files from one location to another π€
-pβ Copy files from one location to another in a single pass. The list of files to copy are read from standard input and written out to a directory relative to the specified directory argument. main character energy, just moving things around.-aβ Reset the access times on files that have been copied.-dβ Create any intermediate directories as needed to write the files at the new location.-Lβ Follow symbolic links.-lβ When possible, link files rather than creating an extra copy.-mβ Restore modification times on files.-uβ Overwrite files even when the original file being copied is older than the one that will be overwritten.-Vβ Print a dot (.) for each file copied.-vβ Be verbose about operations. List filenames as they are copied.
π ENVIRONMENT π
TMPDIRβ Path in which to store temporary files. so you can tell it where to dump its temp stuff, periodt.
πͺ EXIT STATUS πͺ
The paxcpio utility exits with one of the following values:
0β All files were processed successfully. slay, no notes.1β An error occurred. oof, something went wrong bestie.
π©Ί DIAGNOSTICS π©Ί
Whenever paxcpio cannot create a file or a link when extracting an archive or cannot find a file while writing an archive, or cannot preserve the user ID, group ID, file mode, or access and modification times when the -p option is specified, a diagnostic message is written to standard error and a non-zero exit value will be returned, but processing will continue. In the case where paxcpio cannot create a link to a file, unless -M lncp is given, paxcpio will not create a second copy of the file.
If the extraction of a file from an archive is prematurely terminated by a signal or error, paxcpio may have only partially extracted the file the user wanted. Additionally, the file modes of extracted files and directories may have incorrect file bits, and the modification and access times may be wrong.
If the creation of an archive is prematurely terminated by a signal or error, paxcpio may have only partially created the archive, which may violate the specific archive format specification.
β οΈ bestie, pls note: partial extractions and partial archives are a whole mess. signals can interrupt and leave you with weird file bits and wrong times. handle with care.
π SEE ALSO π
π AUTHORS π
Keith Muller at the University of California, San Diego. MirBSD extensions by mirabilos <m@mirbsd.org>.
π CAVEATS π
okay bestie, listen up, this is the important part π«£
Different file formats have different maximum file sizes. Like, they do NOT all hold the same amount, and if you try to shove a huge file into a tiny format it's gonna be a whole situation. So it's recommended that you use a format like cpio or ustar when you're dealing with the big big files. Trust. β¨
Here's the tea on the limits, fr fr:
arβ max file size is 10 Gigabytes - 1 Bytebcpioβ max file size is 4 Gibibytessv4cpioβ max file size is 4 Gibibytessv4crcβ max file size is 4 Gibibytescpioβ max file size is 8 Gibibytestarβ max file size is 8 Gibibytesustarβ max file size is 8 Gibibytes
The backwards-compatible format options are not available in the pax(1) front-end. Yeah that's justβ¦ not a thing there. π
The -M option is a MirBSD extension, and it's been available starting with MirBSD 8. The good news? Archives written using these options are, however, compatible to the standard and should be readable on any other system β iconic behaviour honestly π
The only option whose behaviour is not explicitly allowed by the standard is hard link unification (that's the "write file contents only once" thing) selected by -M 0x0002. So like, that one's a lil rebel. Keep that in mind. π
The -V option is a GNU extension, available starting with MirBSD 11. β¨
And pssst β the ar file format matches APT repositories and the BSD ar(1) specification, not GNU binutils (which can however read them) or SYSV systems. Not me clarifying that so nobody gets confused π
π BUGS π
ngl, there are a couple of things that just⦠aren't a thing yet:
- The
-sand-Soptions are currently not implemented. π They're just vibes and promises rn, bestie. - The
paxfile format is not yet supported. π
and that's the whole page, my love π«Ά you made it all the way through, so proud of you honestly. this was PAXCPIO(1) from MirBSD, dated January 5, 2024 β go forth and archive responsibly, bestie, ily πβ¨ππ¦πΈ
π¦ where this page comes from
- alpine 3.24: pax-doc 20240817-r1 Β· BSD-3-Clause
- arch rolling: pax 20240817-1 Β· BSD-3-Clause
- debian trixie: pax 1:20240817-1
- nixos 26.05: pax 20240817
- nixpkgs unstable: pax 20240817
- ubuntu questing: pax 1:20240817-1
- ubuntu resolute: pax 1:20240817-1build1
- ubuntu stonking: pax 1:20240817-1build1
- Copyright Β© 2005, 2009, 2011, 2012, 2014, 2015, 2016 2017, 2018
- Copyright (c) 1997 SigmaSoft, Th. Lockert
- Copyright Β© 2008, 2009, 2010, 2016, 2018, 2020, 2023 mirabilos <m@mirbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms