THE FILE FIELD GUIDE
.cpio

CPIO Archive

Archives

CPIO packages multiple files and is separate from compression such as gzip. Variants, paths and permissions require care: inspect the listing before extracting into a separate workspace.

Main use
Package collections of Unix-style files
Data type
Binary data
All sections, questions and sources

Content reviewed: · Editor:Kai

Opening steps

Choose your environment or purpose to see its steps.

GNU cpio / libarchive-capable tools

Preserve the original and inspect a working copy in a compatible application.

  1. List names and hierarchy using a compatible tool.
  2. Inspect absolute paths, parent traversal and links.
  3. If appropriate, extract required items into an empty workspace.
Inspect the received file and its requirements

Establish dependencies and settings before proceeding.

  1. Identify whether the CPIO is separately compressed.
  2. Check the variant, such as newc, and tool support.
  3. Establish whether original ownership/permissions must be reproduced.

Menu labels and support vary by app, OS and version. Preserve the original before making changes.

Troubleshooting by symptom

  • Unknown format: inspect outer compression and the CPIO variant.
  • Directories absent: inspect extraction settings.
  • Existing files unchanged: inspect timestamp/overwrite rules without forcing over originals.
  • Permission warnings: distinguish ordinary file retrieval from metadata restoration.

CPIO → files / TAR or ZIP

  1. Inspect, extract copies and optionally repack them in another archive format.
  2. Check item counts, sizes, link treatment and required content.

Repacking to ZIP may not preserve Unix ownership, links and permissions equivalently.

Inspect paths before extraction

Establish where stored names would be written. Do not treat absolute-path stripping as complete protection; use current tools and an isolated workspace.

Source for these steps:GNU · GNU cpio manual / libarchive project · Cpio format

Worked example: checks before handoff

Example: when only documents are needed from a legacy backup, list it first and extract the selected subtree into a separate location.

Source for these steps:GNU · GNU cpio manual / libarchive project · Cpio format

Related-format differences

Related-format differences
Format / methodPurpose and preserved information
.cpioPackage collections of Unix-style files
TAR / GZTAR is another archive; GZ is compression, with different metadata/compatibility.
CPIO → files / TAR or ZIPRepacking to ZIP may not preserve Unix ownership, links and permissions equivalently.

Handling and security

Inspect the listing and extract into isolation, reviewing absolute paths, links and executables.

Questions and answers

Is CPIO itself compression?

It is mainly an archive; compression may be a separate gzip-like layer.

Should I extract as administrator/root?

For ordinary document retrieval, avoid unnecessary privilege and restrict the destination.

Does listing extract files?

Listing and extraction are separate; inspect the selected command mode.

Format facts: name, steward and MIME type
Formal name
CPIO Archive
Steward / specification
GNU
MIME type
Consult the producer or delivery system. The extension alone does not establish a MIME type.

Primary and official sources

  • Project documentationGNU cpio manual

    Listing/extracting archives and pathname handling.

    GNU · Link checked:
  • Project documentationCpio format

    CPIO variants and archive interoperability.

    libarchive project · Link checked: