cpio is a binary file archiver and a file format. A file archiver is a Computer program that combines a number of files together into one Archive file, or a series of archive files for easier transportation A file format is a particular way to encode information for storage in a Computer file. The cpio software utility was meant as a tape archiver that was originally part of PWB/UNIX, and that was also part of UNIX System III and UNIX System V. Utility software (also known as service program, service routine, tool, or utility routine) is a type of Computer software. PWB/UNIX (for Programmer's Workbench) was an early version of the Unix Operating system. UNIX System III (sometimes called System 3) was a version of the Unix operating system released by AT&T 's Unix Support Group (USG Unix System V, commonly abbreviated SysV (and usually pronounced though rarely written as System 5 was one of the versions of the Unix Operating system However, the use of its Research Unix counterpart, tar, and the freely available versions thereof, are widely considered to be a better solution. Research Unix is a term used to refer to versions of the Unix Operating system for DEC PDP-7, PDP-11, VAX and Interdata In Computing, tar (derived from tape archive) is both a File format (in the form of a type of archive Bitstream) and the name [1] cpio's use by the RPM Package Manager continues to make cpio an important archive format. RPM Package Manager ( Red Hat Package Manager, abbreviated RPM) is a Package management system.
Contents |
A cpio archive is a stream of files and directories in a single archive, and often ends with a . cpio file extension. The archive has header information that allows for an application such as the GNU cpio tool to extract the files and directories into a file system. GNU ( pronounced) is a computer Operating system composed entirely of Free software. The header of a cpio archive also contains information such as the file name, time stamp, owner and permissions.
The cpio archive is similar in function to that of a tar archive, and was designed to store backups onto a tape device in a contiguous manner. In Computing, tar (derived from tape archive) is both a File format (in the form of a type of archive Bitstream) and the name Like the Tar format, CPIO archives are often compressed using Gzip and distributed as . In Computing, tar (derived from tape archive) is both a File format (in the form of a type of archive Bitstream) and the name gzip is a Software application used for File compression. gzip is short for GNU zip; the program is a Free software replacement for the cpgz files.
Oracle distributes a large amount of its software in the cpio format. Oracle Corporation ( specializes in developing and marketing Enterprise software products — particularly Database management systems In 2007 Oracle ranked
The cpio utility was standardized in POSIX. POSIX (ˈpɒzɪks or "Portable Operating System Interface" is the collective name of a family of related standards specified by the IEEE to define 1-1988. It was dropped from later revisions, starting with POSIX. 1-2001 due to its 8 GB filesize limit. The POSIX standardized pax utility can be used to read and write cpio archives instead. pax is a utility defined and created by the POSIX.1-2001 standard
The GNU cpio application is a common tool that can be used to put information into a cpio or tar archive. The cpio application is free software, and is available from the GNU web site. Free software or software libre is Software that can be used studied and modified without restriction and which can be copied and redistributed in modified or unmodified
If you wanted to archive an entire directory tree, the find command can provide the file list to cpio:
% find . -depth -print | cpio -ov > tree. cpio
Cpio copies files from one directory tree to another, combining the copy-out and copy-in steps without actually using an archive. It reads the list of files to copy from the standard input; the directory into which it will copy them is given as a non-option argument.
% find . -depth -print0 | cpio --null -pvd new-dir
To extract files from a cpio archive, pass the archive to cpio as its standard input.
Warning: If you are root, files on your filesystem that also exist in the cpio image may be replaced by those in the cpio image if those on your filesystem differ from those in the image!
% cpio -id < cpiofile
The -i flag indicates that cpio is reading in the archive to extract files, and the -d flag tells cpio to construct directories as necessary. You can also use the -v flag to have file names listed as files are extracted.
Any non-option command line arguments are shell globbing patterns; only files in the archive whose names match one or more of those patterns are copied from the archive. The following example extracts etc/fstab from the archive (the format of the archive contents should be verified with cpio -l first to verify how path is stored) :
% cpio -id etc/fstab < cpiofile