1250:
1240:
1230:
304:
The resulting cpio archive is a sequence of files and directories concatenated into a single archive, separated by header sections with file meta information, such as filename, inode number, ownership, permissions, and timestamps. By convention, the file name of an archive is usually given the file
494:
because of its file size and other limitations. For example, the GNU version offers various output format options, such as "bin" (default, and obsolete) and "ustar" (POSIX tar), having a file size limitations of 2,147,483,647 bytes (2 GB) and 8,589,934,591 bytes (8 GB), respectively.
296:
command line flag, cpio reads file and directory path names from its standard input channel and writes the resulting archive byte stream to its standard output. Cpio is therefore typically used with other utilities that generate the list of files to be archived, such as the
236:
Since its original design, cpio and its archive file format have undergone several, sometimes incompatible, revisions. Most notable is the change, now an operational option, from the use of a binary format of archive file meta information to an
276:
cpio was originally designed to store backup file archives on a tape device in a sequential, contiguous manner. It does not compress any content, but resulting archives are often compressed using
439:
operation, but instead of creating an archive, it recreates the directories and files at a different location in the file system, as specified by the path given as a command line argument.
1279:
435:). This mode combines the copy-out and copy-in steps without actually creating any file archive. In this mode, cpio reads path names on standard input like the
910:
816:
374:-patterns; only files in the archive with matching names are copied from the archive. The following example extracts the file
194:), and has been a component of virtually every Unix operating system released thereafter. Its name is derived from the phrase
697:
in The Single UNIX ® Specification, Version 2, 1997, opengroup.org – indicates applications should migrate to pax utility
344:, cpio reads an archive from its standard input and recreates the archived files in the operating system's file system.
316:
utility to generate a list of path names starting in the current directory to create an archive of the directory tree:
584:
81:
1147:
1299:
1284:
1233:
809:
961:
915:
1210:
779:
734:
700:
600:
703:
in The Open Group Base
Specifications Issue 6, 2004 Edition, opengroup.org – indicates cpio as removed
1184:
40:
1289:
1253:
802:
1294:
1243:
556:
148:
694:
1274:
745:
728:
407:
List may be useful since a cpio archive may contain absolute rather than relative paths (e.g.,
981:
551:
1229:
190:
was originally intended as a tape archiving program as part of the
Programmer's Workbench (
8:
1174:
996:
442:
This example copies the directory tree starting at the current directory to another path
214:
86:
869:
849:
519:
252:, a similar utility which had been introduced in the previous version of the standard.
124:
1179:
1159:
1152:
1142:
1137:
1127:
1122:
1112:
1107:
1084:
1079:
1044:
1039:
1034:
1019:
1009:
986:
966:
859:
580:
226:
1004:
976:
187:
93:
65:
630:
A Research Unix reader: annotated excerpts from the
Programmer's Manual, 1971–1986
1169:
854:
210:
203:
110:
370:
Any remaining command line arguments other than the option flags are shell-like
1099:
1074:
825:
628:
261:
209:
All variants of Unix also support other backup and archiving programs, such as
199:
665:
1268:
1164:
503:
249:
230:
175:
163:
718:
1014:
930:
864:
624:
510:
compliant, and so it can read and write cpio and ustar formatted archives.
424:
245:
222:
396:
The files contained in a cpio archive may be listed with this invocation:
991:
298:
179:
1200:
708:
539:
136:
106:
35:
25:
940:
839:
218:
183:
74:
935:
895:
789:
772:
755:
738:
371:
265:
191:
794:
213:, which has become more widely recognized. The use of cpio by the
1059:
1054:
768:
762:
751:
649:
574:
527:
905:
885:
785:
446:
in the file system, preserving files modification times (flag
1024:
890:
678:
531:
487:
238:
102:
1205:
1132:
1117:
1089:
1049:
925:
920:
900:
277:
70:
458:), while producing a progress listing on standard output (
1215:
1069:
1029:
971:
98:
956:
359:
tells cpio to construct directories as necessary. Flag
498:
The cpio, ustar, and pax file formats are defined by
376:
579:. O'Reilly & Associates, Inc. p. 38.13.
454:), replacing any existing files unconditionally (
1280:Unix archivers and compression-related utilities
1266:
271:
198:, in close description of the program's use of
423:Cpio supports a third type of operation which
340:operation, initiated by the command line flag
810:
1239:
817:
803:
575:Peek, J; O'Reilly, T; Loukides, M (1997).
367:) lists file names as they are extracted.
636:(Technical report). CSTR. Bell Labs. 139.
233:) make cpio an important archiving tool.
477:
623:
1267:
798:
617:
568:
1194:Document packaging and distribution
1100:Software packaging and distribution
824:
450:), creating directories as needed (
387:cpio-i-d/etc/fstab<archive.cpio
283:
13:
513:
288:When creating archives during the
225:since version 2.6, and in Apple's
149:Uniform Type Identifier (UTI)
14:
1311:
688:
1249:
1248:
1238:
1228:
713:– 8th Edition of Bell Labs' Unix
186:computer operating systems. The
280:or other external compressors.
182:. It is primarily installed on
671:
659:
640:
593:
490:.1-1988, but was omitted from
292:operation, initiated with the
1:
562:
331:
327:cpio-o>/path/archive.cpio
506:utility, which is currently
272:Operation and archive format
7:
545:
522:provide the GNU version of
486:utility is standardized in
427:. It is initiated with the
178:utility and its associated
52:; 47 years ago
10:
1316:
1211:Open Packaging Conventions
351:cpio-i-vd<archive.cpio
255:
41:AT&T Bell Laboratories
1224:
1193:
1098:
950:Archiving and compression
949:
878:
832:
656:node, bsdcpio manual page
159:
147:
135:
123:
92:
80:
64:
46:
34:
24:
737:User Commands Reference
464:
398:
382:
346:
318:
137:Internet media type
557:List of archive formats
418:
403:cpio-t<archive.cpio
391:
241:-based representation.
1206:OEBPS Container Format
312:This example uses the
266:Programmer's Workbench
244:cpio was removed from
552:List of Unix commands
534:use the BSD-licensed
478:POSIX standardization
1300:GNU Project software
1285:Free backup software
473:cpio-p-dumvnew-path
520:Linux distributions
215:RPM Package Manager
154:public.cpio-archive
120:
21:
16:Archive file format
1201:OEB Package Format
605:pubs.opengroup.org
380:from the archive:
355:Command line flag
206:in its operation.
142:application/x-cpio
125:Filename extension
118:
26:Original author(s)
19:
1262:
1261:
788:General Commands
771:General Commands
754:General Commands
723:– manual from GNU
652:document, in the
508:POSIX 1003.1-2008
469:find.-depth-print
323:find.-depth-print
260:cpio appeared in
169:
168:
116:
115:
1307:
1252:
1251:
1242:
1241:
1232:
879:Compression only
819:
812:
805:
796:
795:
783:
782:
766:
765:
749:
748:
732:
731:
722:
721:
712:
711:
683:
682:
675:
669:
663:
657:
644:
638:
637:
635:
621:
615:
614:
612:
611:
597:
591:
590:
577:Unix Power Tools
572:
537:
525:
472:
468:
461:
457:
453:
449:
434:
402:
386:
362:
358:
350:
343:
326:
322:
295:
284:Archive creation
188:software utility
155:
121:
117:
66:Operating system
60:
58:
53:
22:
18:
1315:
1314:
1310:
1309:
1308:
1306:
1305:
1304:
1290:Archive formats
1265:
1264:
1263:
1258:
1220:
1189:
1170:Package (macOS)
1094:
945:
874:
828:
826:Archive formats
823:
778:
777:
761:
760:
744:
743:
727:
726:
717:
716:
707:
706:
691:
686:
677:
676:
672:
664:
660:
645:
641:
633:
622:
618:
609:
607:
599:
598:
594:
587:
573:
569:
565:
548:
535:
523:
516:
514:Implementations
480:
475:
474:
470:
466:
459:
455:
451:
447:
432:
421:
405:
404:
400:
394:
389:
388:
384:
360:
356:
353:
352:
348:
341:
334:
329:
328:
324:
320:
293:
286:
274:
264:as part of the
258:
204:standard output
196:copy in and out
153:
143:
131:
111:New BSD License
105:
56:
54:
51:
47:Initial release
17:
12:
11:
5:
1313:
1303:
1302:
1297:
1295:File archivers
1292:
1287:
1282:
1277:
1260:
1259:
1257:
1256:
1246:
1236:
1225:
1222:
1221:
1219:
1218:
1213:
1208:
1203:
1197:
1195:
1191:
1190:
1188:
1187:
1182:
1177:
1172:
1167:
1162:
1157:
1156:
1155:
1150:
1145:
1135:
1130:
1125:
1120:
1115:
1110:
1104:
1102:
1096:
1095:
1093:
1092:
1087:
1082:
1077:
1072:
1067:
1064:
1063:
1062:
1052:
1047:
1042:
1037:
1032:
1027:
1022:
1017:
1012:
1007:
1002:
999:
994:
989:
984:
979:
974:
969:
964:
959:
953:
951:
947:
946:
944:
943:
938:
933:
928:
923:
918:
913:
908:
903:
898:
893:
888:
882:
880:
876:
875:
873:
872:
867:
862:
857:
852:
847:
842:
836:
834:
833:Archiving only
830:
829:
822:
821:
814:
807:
799:
793:
792:
775:
758:
741:
724:
714:
704:
698:
690:
689:External links
687:
685:
684:
670:
658:
639:
625:McIlroy, M. D.
616:
592:
585:
566:
564:
561:
560:
559:
554:
547:
544:
538:provided with
515:
512:
479:
476:
465:
420:
417:
399:
393:
390:
383:
347:
333:
330:
319:
285:
282:
273:
270:
262:Version 7 Unix
257:
254:
200:standard input
167:
166:
161:
160:Type of format
157:
156:
151:
145:
144:
141:
139:
133:
132:
129:
127:
114:
113:
96:
90:
89:
84:
78:
77:
68:
62:
61:
48:
44:
43:
38:
32:
31:
28:
15:
9:
6:
4:
3:
2:
1312:
1301:
1298:
1296:
1293:
1291:
1288:
1286:
1283:
1281:
1278:
1276:
1275:1977 software
1273:
1272:
1270:
1255:
1247:
1245:
1237:
1235:
1231:
1227:
1226:
1223:
1217:
1214:
1212:
1209:
1207:
1204:
1202:
1199:
1198:
1196:
1192:
1186:
1183:
1181:
1178:
1176:
1173:
1171:
1168:
1166:
1163:
1161:
1158:
1154:
1151:
1149:
1146:
1144:
1141:
1140:
1139:
1136:
1134:
1131:
1129:
1126:
1124:
1121:
1119:
1116:
1114:
1111:
1109:
1106:
1105:
1103:
1101:
1097:
1091:
1088:
1086:
1083:
1081:
1078:
1076:
1073:
1071:
1068:
1065:
1061:
1058:
1057:
1056:
1053:
1051:
1048:
1046:
1043:
1041:
1038:
1036:
1033:
1031:
1028:
1026:
1023:
1021:
1018:
1016:
1013:
1011:
1008:
1006:
1003:
1000:
998:
995:
993:
990:
988:
985:
983:
980:
978:
975:
973:
970:
968:
965:
963:
960:
958:
955:
954:
952:
948:
942:
939:
937:
934:
932:
929:
927:
924:
922:
919:
917:
914:
912:
909:
907:
904:
902:
899:
897:
894:
892:
889:
887:
884:
883:
881:
877:
871:
868:
866:
863:
861:
858:
856:
853:
851:
848:
846:
843:
841:
838:
837:
835:
831:
827:
820:
815:
813:
808:
806:
801:
800:
797:
791:
787:
784: –
781:
776:
774:
770:
767: –
764:
759:
757:
753:
750: –
747:
742:
740:
736:
733: –
730:
725:
720:
715:
710:
705:
702:
701:C.4 Utilities
699:
696:
693:
692:
680:
674:
667:
662:
655:
651:
648:
643:
632:
631:
626:
620:
606:
602:
596:
588:
586:1-565-92260-3
582:
578:
571:
567:
558:
555:
553:
550:
549:
543:
541:
533:
529:
521:
511:
509:
505:
501:
496:
493:
489:
485:
463:
445:
440:
438:
431:option flag (
430:
426:
416:
414:
410:
397:
381:
379:
378:
373:
368:
366:
345:
339:
317:
315:
310:
308:
302:
300:
291:
281:
279:
269:
267:
263:
253:
251:
247:
242:
240:
234:
232:
228:
224:
220:
216:
212:
207:
205:
201:
197:
193:
189:
185:
181:
177:
176:file archiver
174:is a general
173:
165:
164:File archiver
162:
158:
152:
150:
146:
140:
138:
134:
128:
126:
122:
112:
108:
104:
100:
97:
95:
91:
88:
85:
83:
79:
76:
72:
69:
67:
63:
49:
45:
42:
39:
37:
33:
29:
27:
23:
844:
735:Solaris 11.4
679:"libarchive"
673:
661:
653:
646:
642:
629:
619:
608:. Retrieved
604:
595:
576:
570:
517:
507:
500:POSIX.1-2001
499:
497:
492:POSIX.1-2001
491:
483:
481:
443:
441:
436:
429:pass-through
428:
425:copies files
422:
412:
408:
406:
395:
375:
369:
364:
354:
337:
335:
313:
311:
306:
303:
289:
287:
275:
259:
248:in favor of
246:POSIX.1-2001
243:
235:
223:Linux kernel
208:
195:
171:
170:
36:Developer(s)
601:"Rationale"
336:During the
180:file format
30:Dick Haight
1269:Categories
1234:Comparison
668:. GNU.org.
610:2024-07-18
563:References
540:libarchive
377:/etc/fstab
332:Extraction
305:extension
107:libarchive
941:Zstandard
301:program.
268:project.
227:Installer
219:initramfs
217:, in the
184:Unix-like
109:bsdcpio:
75:Unix-like
1254:Category
1148:Java RAR
896:compress
627:(1987).
546:See also
502:for the
444:new-path
437:copy-out
372:globbing
290:copy-out
192:PWB/UNIX
982:Cabinet
780:cpio(1)
769:OpenBSD
763:cpio(1)
752:FreeBSD
746:cpio(1)
729:cpio(1)
719:cpio(1)
709:cpio(1)
654:Options
536:bsdcpio
528:FreeBSD
409:/bin/ls
365:verbose
338:copy-in
256:History
221:of the
94:License
87:Command
55: (
906:Zopfli
886:Brotli
790:Manual
786:Debian
773:Manual
756:Manual
739:Manual
666:"Cpio"
583:
413:bin/ls
101:cpio:
1025:lrzip
891:bzip2
634:(PDF)
532:macOS
518:Most
488:POSIX
239:ASCII
130:.cpio
103:GPLv3
1244:List
1185:XBAP
1165:MSIX
1118:APPX
1090:ZPAQ
1060:sitx
1050:rzip
1010:.egg
1005:.dmg
1001:DGCA
926:lzop
921:lzip
911:LZMA
901:gzip
870:WARC
850:shar
845:cpio
695:cpio
650:info
647:cpio
581:ISBN
530:and
524:cpio
484:cpio
482:The
419:Copy
411:vs.
392:List
314:find
307:cpio
299:find
278:gzip
202:and
172:cpio
119:cpio
82:Type
73:and
71:Unix
57:1977
50:1977
20:cpio
1216:PAQ
1180:XAP
1175:RPM
1160:MSI
1153:EAR
1143:WAR
1138:JAR
1133:ipa
1128:HAP
1123:deb
1113:App
1108:apk
1085:ZIP
1080:zoo
1075:Xar
1070:UDA
1066:SQX
1055:sit
1045:RAR
1040:PEA
1035:MPQ
1030:LZX
1020:LHA
1015:kgb
997:dar
992:cpt
987:cfs
972:ARJ
967:ARC
962:ACE
916:LZ4
865:WAD
860:LBR
855:tar
504:pax
467:$
462:):
415:).
401:$
385:$
349:$
321:$
250:pax
231:pax
211:tar
99:GNU
1271::
977:B1
957:7z
936:xz
931:SQ
840:ar
603:.
542:.
526:.
309:.
294:-o
818:e
811:t
804:v
681:.
613:.
589:.
471:|
460:v
456:u
452:d
448:m
433:p
363:(
361:v
357:d
342:i
325:|
229:(
59:)
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.