Cpio

From Wikipedia, the free encyclopedia

The correct title of this article is cpio. The initial letter is shown capitalized due to technical restrictions.

cpio is both the name of a binary utility, and a form of digital archive.

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. 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.

The cpio utility was standardized in POSIX.1-1988. It was dropped from later revisions, starting with POSIX.1-2001 due to its 8GB filesize limit. The POSIX standardized pax utility can be used to read and write cpio archives instead.

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.

If you wanted to archive an entire directory tree, the find command can provide the file list to cpio:

% find . -print -depth | 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.

% 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

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.