Learn how cpio archives files, when it beats tar, and practical commands you can run now. 02.03.2026 | reading time: 2 min cpio is a classic Unix utility to copy files into and out of archive streams; it excels when you build archives from programmatic file lists and when you need specific archive formats such as those used for initramfs. Quick hands-on example Create a tiny archive from the current tree, list its contents and extract it back; run these commands exactly: ```bash find . -depth -print | cpio -ov > archive.cpio cpio -it < archive.cpio cpio -idmv < archive.cpio ``` A possible listing output looks like: ``` ./a.txt ./subdir/b.txt ``` Formats, options and tricks Use `--format=newc` for initramfs images, `--null` together with NUL-separated lists from `find -print0` to handle weird filenames, and the pass mode `cpio -pdmv /dest` to copy directory trees while preserving permissions and timestamps; remember `-o` for create, `-i` for extract, and `-t` to list. Typical use cases that pay off Reach for cpio when generating archives from scripted lists, when building initramfs or installer images, or when you want a stream-oriented archive that integrates cleanly with `find` and other filters for selective backups. Other tools you will meet cpio sits among utilities like `tar` and `pax` and is often used in packaging pipelines where payloads are later compressed; choose cpio for format control, tar for convenience, and rsync for efficient synchronisation. Next steps and certification Practice the commands above on a disposable directory, try `--format=newc` for a mini initramfs, and consider formalizing skills with Linux certifications; explore more at bitsandbytes.academy for intensive exam preparation such as CompTIA Linux+ or LPIC-1. Join Bits & Bytes Academy First class LINUX exam preparation. utilities backup scripting filesystem