What is CPIO? Unix Copy In, Copy Out Archive Format Explained

CPIO is a Unix archive format and utility that copies files into and out of archives, preserving metadata and used in RPM packages and Linux initramfs.

Free online file converter tool. Works in Chrome Firefox Safari Edge Opera and other modern browsers on Windows macOS Linux Android and iOS. No software installation or sign-up required. All conversions run directly in your browser, so your files never leave your device. Free to use with no account needed.

Archive

What is CPIO? Unix Copy In, Copy Out Archive Format Explained

A classic Unix archive format that streams files together with their metadata.

Last updated:

Year Created1977
CompressionArchive
Primary UseSystem archiving / packaging

What is CPIO?

cpio, short for 'copy in, copy out', is a Unix utility and the associated archive format used to combine many files into a single stream. It originated in PWB/UNIX and was later standardized in the POSIX.1 specification.

The cpio program reads a list of file names from standard input and writes a concatenation of file headers, metadata, and contents to an archive. Several header variants exist, including the old binary, old ASCII (odc), and the SVR4 'new ASCII' (newc) formats, the last of which is widely used in Linux initramfs images and RPM payloads.

How cpio Works

cpio is a stream archiver: it consumes a newline-separated list of pathnames on standard input and emits a flat sequence of records, each pairing a header of metadata with the corresponding file contents.[1] The archive ends with a special trailer entry named TRAILER!!!. This pipe-friendly design lets cpio cooperate with tools such as find to select exactly which files to archive.[1]

Header Formats and Standardization

Several incompatible header variants exist, including the old binary format, the portable old ASCII (odc) format, and the SVR4 new ASCII (newc) format; the ASCII formats were created to be portable across architectures with differing byte orders.[2] The cpio interchange format and utility are standardized in POSIX.[3]

Modern Usage

Although superseded by tar for general archiving, the newc format remains central on Linux, where it packages initramfs boot images and forms the payload inside RPM packages.[2] The old binary format is limited in the file sizes and inode values it can represent, motivating the ASCII variants.[1]

MKV Technical Specifications

DeveloperAT&T Bell Labs / GNU Project (GNU cpio)[1]
File Extension.cpio[1]
MIME Typeapplication/x-cpio[1]
Released1977 (PWB/UNIX)[1]
TypeArchive (no built-in compression)[1]

CPIO vs Other Archive Formats

FeatureCPIOTARZIP
TypeStream archiver[2]Stream archiverCompressed archive
Built-in compressionNo[1]NoYes
Standardized byPOSIX[3]POSIXPKWARE
OS supportUnix-likeUniversalUniversal
Best forRPM payloads, initramfsUnix backupsGeneral sharing

CPIO and TAR bundle files without compressing them, whereas ZIP combines bundling and compression in one container.

Advantages & Disadvantages

Advantages

Preserves metadata | FileFormer

Stores ownership, permissions, timestamps, and device information, making it suitable for full system archiving.

Stream-oriented | FileFormer

Operates on a stream of files from standard input, which pipes cleanly with find and other Unix tools.

POSIX standardized | FileFormer

The format is described in POSIX.1, giving it a stable, well-documented specification.

Foundational role | FileFormer

Used as the payload container inside RPM packages and Linux initramfs images.

Disadvantages

No native compression | FileFormer

cpio archives are uncompressed and must be paired with gzip or xz to reduce size.

Format fragmentation | FileFormer

Multiple incompatible header variants can cause confusion and portability issues.

Less user-friendly | FileFormer

Its command-line interface is considered less intuitive than tar for everyday use.

Common Use Cases

cpio is most often encountered in system-level archiving and Linux packaging.

RPM package payloads | FileFormer

RPM packages store their installable files in a cpio archive, typically compressed with gzip or xz.

Linux initramfs | FileFormer

The initial RAM filesystem loaded by the Linux kernel is packaged as a cpio archive.

System backups | FileFormer

Combined with find, cpio can archive directory trees while preserving file metadata.

Convert CPIO Files Free

Use our free online archive converter to convert CPIO and other formats - no signup, no watermarks.

Try Archive Converter Free

Frequently Asked Questions

What does cpio stand for?

It stands for 'copy in, copy out', reflecting the two main operating modes of the utility.

Is cpio the same as tar?

No, but they are similar. Both bundle files with metadata; cpio reads file lists from standard input, while tar takes paths as arguments and is more common for general use.

Does cpio compress files?

No. cpio only archives files. Compression is added separately, usually by piping the output through gzip or xz.

What is the 'newc' format?

newc is the SVR4 portable ASCII header format, widely used for Linux initramfs and RPM payloads because it supports large device numbers.

How do I extract a cpio archive?

Run cpio in extract mode, for example 'cpio -idv < archive.cpio', optionally decompressing the stream first.

References

  1. GNU cpio Manual - GNU Project
  2. cpio - Wikipedia
  3. cpio - POSIX / The Open Group Base Specifications