SCPIO(1L)
π SCPIO(1L) π
okay bestie, welcome to the scpio page from SchilyΒ΄s USER COMMANDS! this is the LEGACY girlie and she's here to copy file archives in and out. let's get into it. π
π NAME π
scpio β copy file archives in and out (LEGACY)
β¨ SYNOPSIS β¨
scpio [ other options ] -o[aBcv]
scpio [ other options ] -i[Bcdmruvf] [ pattern ... ]
scpio [ other options ] -it[Bcvf] [ pattern ... ]
scpio [ other options ] -p[adlmuv] directory
πΈ DESCRIPTION πΈ
The scpio utility, depending on the options used:
- copies files to an archive file
- extracts files from an archive file
- lists files from an archive file
- copies files from one directory tree to another.
π OPTIONS π
The scpio utility supports the XBD specification Utility Syntax Guidelines. The cpio standard does not allow the option modifiers to be presented as separate arguments from the option letters. The scpio implementation allows option modifiers to be presented as separate arguments from the option letters. When writing portable shell scripts do never make use of this feature.
bestie, that's a portability warning, fr fr. do not use that glow-up in scripts that need to travel. π
The following options are supported:
-oβ (Copy Out.) Read the standard input to obtain a list of pathnames and copy those files onto the standard output together with pathname and status information. Output is padded to a 512-byte boundary.-iβ (Copy In.) Extract files from the standard input, which is assumed to be the product of a previousscpio -o. Only files with names that match patterns are selected. The extracted files are conditionally created and copied into the current directory tree based upon the options described below. The permissions of the files will be those of the previousscpio -o. The owner and group of the files will be that of the current user unless the user has appropriate privileges, which causesscpioto retain the owner and group of the files of the previousscpio -o. If the archive being read does not match the modifier specified,scpiomay consider this to be an error and exit or may recognise the archive and continue processing. Only a user with appropriate privileges can extract block special or character special files from an archive.-itβ (List.) List files from the archive. This is a sub mode of the copy in mode, no files are created in list mode.-pβ (Pass.) Read the standard input to obtain a list of pathnames of files that are conditionally created and copied into the destination directory tree based upon the option modifiers described below.
The following option modifiers can be appended in any sequence to the -o, -i or -p options:
aβ Reset access times of input files after they have been copied. (When optionl(see below) is also specified, the access times of the linked files are not reset.)Bβ Block input/output 5120 bytes to the record (does not apply to the-poption; meaningful only with data directed to or from character special files).dβ Create directories as needed.cβ Write or read header information in character form for portability. Note that the Open Group standard does not specify the archive format that should be used with thecoption. For this reason it is questionable whether thecoption increases portability in general.
The archive format used by scpio with the c option is the format from the -H asc option. It gives best cpio compatibility when transferring files to SVR4-based systems (except that the file size is limited to 2 gigabytes). When transferring files in cpio archives to unknown operating systems, it is unwise to use the c option.
rβ Interactively rename files. For each archive member matching pattern operand, a prompt will be written to the file/dev/tty. The prompt will contain the name of the archive member, but the format is otherwise unspecified. A line will then be read from/dev/tty. If this line is blank, the archive member will be skipped. If this line consists of a single period, the archive member will be processed with no modification to its name. Otherwise, its name will be replaced with the contents of the line. Thescpioutility will immediately exit with a non-zero exit status if end-of-file is encountered when reading a response, or if/dev/ttycannot be opened for reading and writing.tβ Write a table of contents of the input. No files are created.uβ Copy unconditionally (normally, an older file will not replace a newer file with the same name).vβ Verbose: print the names of the affected files. With thetoption, provides a detailed listing.lβ Whenever possible, link files rather than copying them. Usable only with the-poption. Theloption modifier is not yet supported byscpio.mβ Retain previous file modification time. This option is ineffective on directories that are being copied.fβ Copy in all files except those in patterns.
The following other options are implemented as SVr4 compliant extension to the Open Group standard:
-6β Extract UNIX System Sixth Editioncpioarchives. This option is not valid in archive create mode, it is mutually exclusive with-c,-H, andartype=. As is is unclear how UNIX System Sixth Editioncpioarchives look like, this option is currently unsupported.-@β Include extended file attributes in the archive. This option is currently unsupported.-Aβ Append files to an existing archive. The-Aoption only works together with the-Ooption. Seestar -rfor more information.-bβ Reverses the order of the bytes within each word. It is unclear what a word is supposed to be. This option is unsupported but not needed asscpioincludes automatic byte order recognition.-C #β Sets (input/output) archive block size to#bytes.-E nameβ Read filenames for store/create/list command fromname. The file name must contain a list of filenames, each on a separate line.-H headerβ Set the archive type toheader. Seestar(1)for more information.-I nmβ Usenmas archive file name instead of stdin.-kβ Try to skip corrupt archive headers.-Lβ Follow symbolic links as if they were files.-M messageβ Define a message that is uses when switching media. This option is currently unsupported.-O nmβ Usenmas archive file name instead of stdout.-Pβ Handle Access Control List (ACL) information in create and extract mode. Seestar -aclfor more information.-R nmβ Reassign ownership and group for all files based onnm. This option is currently unsupported.-sβ Reverses the order of the bytes within each word. It is unclear what a word is supposed to be. This option is unsupported but not needed asscpioincludes automatic byte order recognition.-Sβ Reverses the order of the halfwords within each word. It is unclear what a word is supposed to be. This option is unsupported but not needed asscpioincludes automatic byte order recognition.-Vβ Special verbose. Print a dot for each file that is read or written. This option is currently unsupported.
The following other options are implemented as star extension to the Open Group standard:
-helpβ Prints a summary of the most important options forscpio(1)and exits.-xhelpβ Prints a summary of the less important options forscpio(1)and exits.-versionβ Prints thescpioversion number string and exists.-/β Don't strip leading slashes from file names when extracting an archive. Seestar(1)for more information...β Don't skip files that contain/../in the name. Seestar(1)for more information.-7zβ run the input or output through ap7zippipe - see option-zbelow.
Note that the p7zip program currently does not operate on a pipe but on a /tmp file copy and thus limits the maximum archive size.
-aclβ Handle Access Control List (ACL) information in create and extract mode. Seestar(1)for more information.artype=headerβ Set the archive type toheader. Seestar(1)for more information.-lzoβ Run the input or output through alzoppipe - see option-zbelow.-bzβ Run the input or output through abzip2pipe - see option-zbelow. As the-bzthe-zoptions are non standard, it makes sense to omit-bzoptions the inside shell scripts. If you are going to extract a compressed archive that is located inside a plain file,scpiowill auto detect compression and choose the right decompression option to extract.bs=#β Set block size to#. You may use the same method as indd(1)andsdd(1). Seestar(1)for more information.-fifostatsβ Print fifo statistics at the end of ascpiorun when the fifo has been in effect.fs=#β Set fifo size to#. Seestar(1)for more information.-no-fifoβ Do not use a fifo to optimize data flow from/to tape. Seestar(1)for more information.-no-fsyncβ Do not callfsync(2)for each file that has been extracted from the archive. Seestar(1)for more information.-do-fsyncβ Callfsync(2)for each file that has been extracted from the archive. Seestar(1)for more information.-no-statisticsβ Do not print statistic messages at the end of ascpiorun.-secure-linksβ Do not extract hard links or symbolic links if the link name (the target of the link) starts with a slash (/) or if/../is contained in the link name. Seestar(1)for more information.-numericβ Use the numeric user/group fields in the listing rather than the default. Seestar(1)for more information.-timeβ Print timing info. Seestar(1)for more information.-xfflagsβ Store and extract extended file flags as found on BSD and Linux systems. Seestar -aclfor more information.-zβ Run the input or output through agzippipe - see option-bzabove. As the-bzthe-zoptions are non standard, it makes sense to omit-bzoptions the inside shell scripts. If you are going to extract a compressed archive that is located inside a plain file,scpiowill auto detect compression and choose the right decompression option to extract.-zstdβ run the input or output through azstdpipe - see option-zabove.
π OPERANDS π
Okay bestie, here's the cast of characters you can actually hand to scpio:
directoryβ a pathname of a directory that already exists, and it's gonna be the target ofscpio -p. Like, it has to be there already, we're not building it for you πpatternβ expressions that use a pattern-matching notation kinda like what the shell does for filename pattern matching, and also kinda like regular expressions. Here are the metacharacters, periodt:*β matches any string, even the empty string (yes, empty, it's giving generous β¨)?β matches any single character[...]β matches any one of the characters inside the brackets. A pair of characters separated by-matches any symbol between that pair, inclusive, as defined by the system default collating sequence. And heads up: if the first character after the opening[is a!, the results are unspecified π (so maybe don't)
Inside pattern, the special characters ?, * and [ also match the / character. You can specify multiple cases of pattern, and if you don't specify any pattern at all, the default is * β meaning select all files, we love a "select everything" moment π
Lowkey important note:scpiodoes not usefnmatch(3)based pattern matching like the stuff documented above. It uses the pattern matcher documented inmatch(1)instead. So like, read that one too, bestie π«Ά
π₯ STDIN π₯
- When the
-oor-poptions are used, standard input is a text file with a list of pathnames, one per line, that are gonna be copied. - When the
-ioption is used, standard input is an archive file formatted in any way the archive handling engine understands (peep the-H helpoption for the full list, iykyk).
ποΈ INPUT FILES ποΈ
The files identified by the pathnames on standard input can be of any type. No discrimination here, we accept everyone π
When the -r option is used, the file /dev/tty is used to write prompts and read responses. So it's literally talking directly to your terminal, main character energy fr.
β‘ ASYNCHRONOUS EVENTS β‘
Default. That's it. That's the whole section. Slay π
π€ STDOUT π€
When the -o option is used, standard output is an archive file formatted as specified by pax with the -x cpio option. And because we want better compatibility with SVR4-based systems that don't implement the cpio format correctly, scpio by default limits the length of file names to 256 bytes. If you want the full thing, use scpio -H cpio to explicitly switch to the full POSIX 1003.1-1988 cpio archive format π
Otherwise (i.e. not -o), standard output contains commentary in an unspecified format concerning the progress of the execution. Vague on purpose, we love a mystery π¦
π¨ STDERR π¨
When the -o option is not used, standard error contains commentary in an unspecified format concerning the progress of the execution.
Otherwise, standard error is used only for diagnostic messages. So when -o is on, stderr is strictly for "something went wrong" energy π
πΎ OUTPUT FILES πΎ
Output files get created, as specified by the archive, when the -i or -p options are used. That's the whole vibe β¨
π EXIT STATUS π
Here's what you get back:
0β successful completion, we ate π>0β an error occurred π
π« CONSEQUENCES OF ERRORS π«
If a file or directory can't be created or overwritten, scpio just continues with the next file in the archive, or the next file to be added to the archive. No dramatic exit, it just keeps it moving, resilient queen π
π§ APPLICATION USAGE π§
Archives created by scpio are portable between XSI-conformant systems, provided the same procedures are used. Same recipe, same result, no cap.
The shell metacharacter notation is not fully compatible with the notation used by the shell and the pax utility. Also, not all systems support the negation character [! ...] in cpio patterns β so portable applications must avoid using this notation. Like, just don't, bestie π
For portable communication of data between XSI-conformant systems, the recommendation is:
- only use characters defined in the ISO/IEC 646:1991 standard International Reference Version (equivalent to ASCII) 7-bit range of characters
- and only use characters defined in the Portable Filename Character Set for naming files
This recommendation exists because XSI-conformant systems support diverse codesets and run in various geographical areas, and there's no single, well-established codeset that incorporates all the characters of the languages of those various geographical areas. Basically, everyone's speaking a different language and we need a lingua franca π
β οΈ The cpio archive format only supports file sizes up to 8 gigabytes. That's the ceiling, babe.
Applications should migrate to the pax archive format, which is the POSIX 1003.1-2001 standard archive format and is based on an extended tar format. Future-proof yourself β¨
π EXAMPLES π
- Copy the contents of a directory onto an archive:
ls | scpio -o >../cpio.out
- Duplicate a directory hierarchy:
cd olddir
find . -depth -print | scpio -pd ../newdir
πΈ ENVIRONMENT πΈ
These environment variables can affect how scpio runs:
TZβ determines the timezone used with date and time strings. (Yes, timezones are the drama, always π)
π SEE ALSO π
ar(1), find(1), sfind(1), ls(1), match(1), pax(1), spax(1), tar(1), star(1).
Go read those too, they're all part of the friend group π«Ά
π NOTES π
The default block size for cpio is 512 bytes, and this slows down write speed. So use -B, -C, or bs= to set a different block size. Speed it up, bestie ποΈ
Scpio -iu is equivalent to star -xU -install -force-remove -remove-recursive, and for this reason it may remove nonempty directory trees in extrace mode without printing a warning. That's a whole lot of destructive power with zero heads-up. Be careful, fr fr π
The Open Group has given us permission to reprint portions of their documentation. In the following statement, the phrase ``this text'' refers to portions of the system documentation.
Portions of this text are reprinted and reproduced in electronic form in the scpio manual, from The Open Group Base Specifications Issue 5, Copyright (C) 1997 by The Open Group. In the event of any discrepancy between these versions and the original specification, the original The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/single_unix_specification_v2.
(Yes we have to say all that. Legal said so. π )
π BUGS π
None currently known. Iconic behaviour honestly πβ¨
Mail bugs and suggestions to schilytools@mlists.in-berlin.de or open a ticket at https://codeberg.org/schilytools/schilytools/issues.
The mailing list archive may be found at:
https://mlists.in-berlin.de/mailman/listinfo/schilytools-mlists.in-berlin.de
π AUTHORS π
Joerg Schilling and the schilytools project authors. Legends, honestly π«Ά
π¦ SOURCE DOWNLOAD π¦
The source code for scpio is included in the schilytools project and may be retrieved from the schilytools project at Codeberg at:
https://codeberg.org/schilytools/schilytools
The download directory is:
https://codeberg.org/schilytools/schilytools/releases
And that's the whole page, bestie π This was SCPIO(1L) by Joerg Schilling, dated 2022/08/17, straight out of the schilytools project. Go forth and archive responsibly, mwah πβ¨
π¦ where this page comes from
- fedora 44: star 2024.03.21-6.fc44 Β· CDDL-1.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND LicenseRef-Fedora-Public-Domain
- opensuse-leap 16.0: star 1.6.1-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: star 1.6.1-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: star 1.6.1-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: star 1.6.1-160000.2.2 Β· CDDL-1.0
- Copyright (C) 1997 by The Open Group, Copyright (C) 2004-2020 J. Schilling
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms