source: freewrt/tools/paxmirabilis/src/cpio.1@ bceb42b

freewrt_1_0 freewrt_2_0
Last change on this file since bceb42b was bceb42b, checked in by Thorsten Glaser <tg@…>, 19 years ago

wbx@ asked me a few seconds too late to use an src/ subdirectory

git-svn-id: svn://www.freewrt.org/trunk/freewrt@204 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 9.2 KB
Line 
1.\" $MirOS: src/bin/pax/cpio.1,v 1.14 2006/06/23 23:16:55 tg Exp $
2.\" $OpenBSD: cpio.1,v 1.23 2006/01/03 17:22:47 jmc Exp $
3.\"
4.\" Copyright (c) 2005 Thorsten Glaser <tg@66h.42h.de>
5.\" Copyright (c) 1997 SigmaSoft, Th. Lockert
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27.\"
28.Dd June 24, 2006
29.Dt CPIO 1
30.Os
31.Sh NAME
32.Nm cpio
33.Nd copy file archives in and out
34.Sh SYNOPSIS
35.Nm cpio
36.Fl o
37.Op Fl aABcLvzZ
38.Op Fl C Ar bytes
39.Op Fl F Ar archive
40.Op Fl H Ar format
41.Op Fl M Ar flag
42.Op Fl O Ar archive
43.Ar "< name-list"
44.Op Ar "> archive"
45.Nm cpio
46.Fl i
47.Op Fl bBcdfmrsStuvzZ6
48.Op Fl C Ar bytes
49.Op Fl E Ar file
50.Op Fl F Ar archive
51.Op Fl H Ar format
52.Op Fl I Ar archive
53.Op Ar "pattern ..."
54.Op Ar "< archive"
55.Nm cpio
56.Fl p
57.Op Fl adlLmuv
58.Ar destination-directory
59.Ar "< name-list"
60.Sh DESCRIPTION
61The
62.Nm
63command copies files to and from a
64.Nm
65archive.
66.Pp
67The options are as follows:
68.Bl -tag -width Ds
69.It Fl o
70Create an archive.
71Reads the list of files to store in the
72archive from standard input, and writes the archive on standard
73output.
74.Bl -tag -width Ds
75.It Fl a
76Reset the access times on files that have been copied to the
77archive.
78.It Fl A
79Append to the specified archive.
80.It Fl B
81Set block size of output to 5120 bytes.
82.It Fl c
83Use ASCII format for
84.Nm
85header for portability.
86.It Fl C Ar bytes
87Set the block size of output to
88.Ar bytes .
89.It Fl F Ar archive
90.It Fl O Ar archive
91Use the specified file name as the archive to write to.
92.It Fl H Ar format
93Write the archive in the specified format.
94Recognised formats are:
95.Pp
96.Bl -tag -width sv4cpio -compact
97.It Ar bcpio
98Old binary
99.Nm
100format.
101Selected by
102.Fl 6 .
103.It Ar cpio
104Old octal character
105.Nm
106format.
107Selected by
108.Fl c .
109.It Ar sv4cpio
110SVR4 hex
111.Nm
112format.
113.It Ar sv4crc
114SVR4 hex
115.Nm
116format with checksums.
117This is the default format for creating new archives.
118.It Ar tar
119Old tar format.
120.It Ar ustar
121POSIX ustar format.
122.It "\ "
123.It Ar bin
124These
125.It Ar crc
126four
127.It Ar newc
128formats
129.It Ar odc
130are supported for backwards compatibility only.
131.El
132.It Fl L
133Follow symbolic links.
134.It Fl M Ar flag
135Configure the archive normaliser.
136.Ar flag
137is either a numeric value compatible to
138.Xr strtonum 3
139which is directly stored in the flags word, or
140one of the following values, prefixed with
141.Dq no-
142to turn them off, or not, to turn them on:
143.Pp
144.Bl -tag -width xxxxxx -compact
145.It Ar inodes
1460x0001: Serialise inodes, zero device info.
147.It Ar links
1480x0002: Store content of hard links only once.
149.It Ar mtime
1500x0004: Zero out the file modification time.
151.It Ar uidgid
1520x0008: Set owner to 0:0 (root:wheel).
153.It Ar dist
1540x000B: Clean everything except mtime.
155.It Ar set
1560x0003: Keep ownership and mtime intact.
157.It Ar norm
1580x000F: Clean everything.
159.It Ar root
1600x0009: Clean owner and device information.
161.It Ar verb
1620x0010: Debug this option.
163.It Ar debug
1640x0020: Debug file header storage.
165.El
166.Pp
167This option is only implemented for the cpio, sv4cpio,
168ustar, and sv4crc file format writing routines.
169For the ustar format, the
170.Ar inodes
171and
172.Ar links
173specifiers are ignored.
174.It Fl v
175Be verbose about operations.
176List filenames as they are written to the archive.
177.It Fl z
178Compress archive using
179.Xr gzip 1
180format.
181.It Fl Z
182Compress archive using
183.Xr compress 1
184format.
185.El
186.It Fl i
187Restore files from an archive.
188Reads the archive file from
189standard input and extracts files matching the
190.Ar patterns
191that were specified on the command line.
192.Bl -tag -width Ds
193.It Fl b
194Do byte and word swapping after reading in data from the
195archive, for restoring archives created on systems with
196a different byte order.
197.It Fl B
198Set the block size of the archive being read to 5120 bytes.
199.It Fl c
200Expect the archive headers to be in ASCII format.
201.It Fl C Ar bytes
202Read archive written with a block size of
203.Ar bytes .
204.It Fl d
205Create any intermediate directories as needed during
206restore.
207.It Fl E Ar file
208Read list of file name patterns to extract or list from
209.Ar file .
210.It Fl f
211Restore all files except those matching the
212.Ar patterns
213given on the command line.
214.It Fl F Ar archive
215.It Fl I Ar archive
216Use the specified file as the input for the archive.
217.It Fl H Ar format
218Read an archive of the specified format.
219Recognised formats are:
220.Pp
221.Bl -tag -width sv4cpio -compact
222.It Ar bcpio
223Old binary
224.Nm
225format.
226.It Ar cpio
227Old octal character
228.Nm
229format.
230.It Ar sv4cpio
231SVR4 hex
232.Nm
233format.
234.It Ar sv4crc
235SVR4 hex
236.Nm
237format with checksums.
238.It Ar tar
239Old tar format.
240.It Ar ustar
241POSIX ustar format.
242.It "\ "
243.It Ar bin
244These
245.It Ar crc
246four
247.It Ar newc
248formats
249.It Ar odc
250are supported for backwards compatibility only.
251.El
252.It Fl m
253Restore modification times on files.
254.It Fl r
255Rename restored files interactively.
256.It Fl s
257Swap bytes after reading data from the archive.
258.It Fl S
259Swap words after reading data from the archive.
260.It Fl t
261Only list the contents of the archive, no files or
262directories will be created.
263.It Fl u
264Overwrite files even when the file in the archive is
265older than the one that will be overwritten.
266.It Fl v
267Be verbose about operations.
268List filenames as they are copied in from the archive.
269.It Fl z
270Uncompress archive using
271.Xr gzip 1
272format.
273.It Fl Z
274Uncompress archive using
275.Xr compress 1
276format.
277.It Fl 6
278Process old-style
279.Nm
280format archives.
281.El
282.It Fl p
283Copy files from one location to another in a single pass.
284The list of files to copy are read from standard input and
285written out to a directory relative to the specified
286.Ar directory
287argument.
288.Bl -tag -width Ds
289.It Fl a
290Reset the access times on files that have been copied.
291.It Fl d
292Create any intermediate directories as needed to write
293the files at the new location.
294.It Fl l
295When possible, link files rather than creating an
296extra copy.
297.It Fl L
298Follow symbolic links.
299.It Fl m
300Restore modification times on files.
301.It Fl u
302Overwrite files even when the original file being copied is
303older than the one that will be overwritten.
304.It Fl v
305Be verbose about operations.
306List filenames as they are copied.
307.El
308.El
309.Sh ENVIRONMENT
310.Bl -tag -width Fl
311.It Ev TMPDIR
312Path in which to store temporary files.
313.El
314.Sh ERRORS
315.Nm
316will exit with one of the following values:
317.Bl -tag -width 2n
318.It 0
319All files were processed successfully.
320.It 1
321An error occurred.
322.El
323.Pp
324Whenever
325.Nm
326cannot create a file or a link when extracting an archive or cannot
327find a file while writing an archive, or cannot preserve the user
328ID, group ID, file mode, or access and modification times when the
329.Fl p
330option is specified, a diagnostic message is written to standard
331error and a non-zero exit value will be returned, but processing
332will continue.
333In the case where
334.Nm
335cannot create a link to a file,
336.Nm
337will not create a second copy of the file.
338.Pp
339If the extraction of a file from an archive is prematurely terminated
340by a signal or error,
341.Nm
342may have only partially extracted the file the user wanted.
343Additionally, the file modes of extracted files and directories may
344have incorrect file bits, and the modification and access times may
345be wrong.
346.Pp
347If the creation of an archive is prematurely terminated by a signal
348or error,
349.Nm
350may have only partially created the archive, which may violate the
351specific archive format specification.
352.Sh SEE ALSO
353.Xr pax 1 ,
354.Xr tar 1
355.Sh AUTHORS
356Keith Muller at the University of California, San Diego.
357.Sh CAVEATS
358Different file formats have different maximum file sizes.
359It is recommended that a format such as cpio or ustar
360be used for larger files.
361.Pp
362.Bl -column "File format" "Maximum file size" -offset indent -compact
363.It Sy "File format" Ta Sy "Maximum file size"
364.It bcpio Ta 4 Gibibytes
365.It sv4cpio Ta 4 Gibibytes
366.It cpio Ta 8 Gibibytes
367.It tar Ta 8 Gibibytes
368.It ustar Ta 8 Gibibytes
369.El
370.Sh BUGS
371The
372.Fl s
373and
374.Fl S
375options are currently not implemented.
376.Sh CAVEATS
377The backwards-compatible format options are not available in the
378.Xr pax 1
379front-end.
380.Pp
381The
382.Fl M
383option is a MirOS extensions, available starting with
384.Mx 8 .
385Archives written using these options are, however, compatible to
386the standard and should be readable on any other system.
387The only option whose behaviour is not explicitly allowed by the
388standard is hard link unification (write file contens only once)
389selected by
390.Fl M Ar 0x0002 .
Note: See TracBrowser for help on using the repository browser.