Cpio

Cpio

cpio is a binary file archiver and a file format. 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. However, the use of its Research Unix counterpart, tar, and the freely available versions thereof, are widely considered to be a better solution.Peek J, O'Reilly T, Loukides M. 1997. Unix Power Tools. O'Reilly & Associates, Inc. ISBN 1-56592-260-3.] cpio's use by the RPM Package Manager continues to make cpio an important archive format.

cpio archive

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. 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. Like the Tar format, CPIO archives are often compressed using Gzip and distributed as .cpgz files.

Oracle distributes a large amount of its software in the cpio format.

POSIX and cpio

The cpio utility was standardized in "POSIX.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.

GNU cpio

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 [http://www.gnu.org/software/cpio/cpio.html the GNU web site] .

Example use

If you wanted to archive an entire directory tree, the find commandcan provide the file list to cpio: % find . -print | cpio -ov > tree.cpioCpio copies files from one directory tree toanother, combining the copy-out and copy-in steps without actuallyusing an archive. It reads the list of files to copy from the standardinput; the directory into which it will copy them is given as anon-option argument. % find . -print0 | cpio --null -pvd new-dirTo 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 < cpiofileThe -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

See also

*List of Unix programs
*List of archive formats

Cited references

External links

* [http://www.gnu.org/software/cpio/manual/html_mono/cpio.html GNU cpio manual]
* [http://www.gnu.org/software/cpio/cpio.html GNU cpio web site]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • cpio — ist ein Archivierungsprogramm und Dateiformat aus dem Unix Umfeld, welches in seiner grundlegenden Funktionsweise (nicht jedoch bei der Kommandozeilenschnittstelle) dem Kommando tar ähnelt. Die Abkürzung cpio steht für „copy in, copy out“. Mit… …   Deutsch Wikipedia

  • cpio — Тип Архиватор Разработчик Проект GNU Написана на C Операционная система Unix like Последняя версия 2.11 (10 марта 2010) Лицензия …   Википедия

  • Cpio — (сокр. от англ. Copy Input/Output)  двоичный архиватор и формат файла. Утилита cpio применялась как ленточный архиватор (tape archiver), первоначально являвшийся частью PWB/UNIX, а также частью UNIX System III и UNIX System V. Однако,… …   Википедия

  • CPIO — ist ein Archivierungsprogramm und Dateiformat aus dem Unix Umfeld, welches in seiner Funktionsweise dem Kommando tar ähnelt. Die Abkürzung cpio steht für „copy in, copy out“. Mit cpio können Dateien sequentiell in eine Archivdatei oder auf… …   Deutsch Wikipedia

  • Cpio — ist ein Archivierungsprogramm und Dateiformat aus dem Unix Umfeld, welches in seiner Funktionsweise dem Kommando tar ähnelt. Die Abkürzung cpio steht für „copy in, copy out“. Mit cpio können Dateien sequentiell in eine Archivdatei oder auf… …   Deutsch Wikipedia

  • cpio — Developer(s) GNU Project Stable release 2.11  (March 10, 2010; 19 months ago (2010 03 10)) …   Wikipedia

  • Cpio — est un utilitaire d archivage ainsi qu un format de fichier utilisé sur UNIX. Il était conçu à l origine comme un moyen de sauvegarder des données sur bande magnétique sur les premières versions d UNIX System III et UNIX System V. Il est… …   Wikipédia en Français

  • Cpio — Saltar a navegación, búsqueda cpio es el nombre de una utilidad binaria tanto como del formato asociado a ésta, .cpio . Este tipo de archivo fue inicialmente creado para el almacenamiento de copias de seguridad en cintas magnéticas de una forma… …   Wikipedia Español

  • cpio — En informatique, cpio est un utilitaire d archivage ainsi qu un format de fichier utilisé sur UNIX. Il était conçu à l origine comme un moyen de sauvegarder des données sur bande magnétique sur les premières versions d UNIX System III et UNIX… …   Wikipédia en Français

  • CPIO — Copy In/Out …   Acronyms

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”