logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

cpio.1 (7885B)


  1. .\" $OpenBSD: cpio.1,v 1.37 2023/12/09 23:00:11 jca Exp $
  2. .\"
  3. .\" Copyright (c) 1997 SigmaSoft, Th. Lockert
  4. .\" All rights reserved.
  5. .\"
  6. .\" Redistribution and use in source and binary forms, with or without
  7. .\" modification, are permitted provided that the following conditions
  8. .\" are met:
  9. .\" 1. Redistributions of source code must retain the above copyright
  10. .\" notice, this list of conditions and the following disclaimer.
  11. .\" 2. Redistributions in binary form must reproduce the above copyright
  12. .\" notice, this list of conditions and the following disclaimer in the
  13. .\" documentation and/or other materials provided with the distribution.
  14. .\"
  15. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  16. .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  17. .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  18. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  19. .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  22. .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. .\"
  26. .Dd $Mdocdate: December 9 2023 $
  27. .Dt CPIO 1
  28. .Os
  29. .Sh NAME
  30. .Nm cpio
  31. .Nd copy file archives in and out
  32. .Sh SYNOPSIS
  33. .Nm cpio
  34. .Fl o
  35. .Op Fl AaBcjLvZz
  36. .Op Fl C Ar bytes
  37. .Op Fl F Ar archive
  38. .Op Fl H Ar format
  39. .Op Fl O Ar archive
  40. .No \*(Lt Ar name-list
  41. .Op \*(Gt Ar archive
  42. .Nm cpio
  43. .Fl i
  44. .Op Fl 6BbcdfjmrSstuvZz
  45. .Op Fl C Ar bytes
  46. .Op Fl E Ar file
  47. .Op Fl F Ar archive
  48. .Op Fl H Ar format
  49. .Op Fl I Ar archive
  50. .Op Ar pattern ...
  51. .Op \*(Lt Ar archive
  52. .Nm cpio
  53. .Fl p
  54. .Op Fl adLlmuv
  55. .Ar destination-directory
  56. .No \*(Lt Ar name-list
  57. .Sh DESCRIPTION
  58. The
  59. .Nm
  60. command copies files to and from a
  61. .Nm
  62. archive.
  63. .Pp
  64. The options are as follows:
  65. .Bl -tag -width Ds
  66. .It Fl o
  67. Create an archive.
  68. Reads the list of files to store in the
  69. archive from standard input, and writes the archive on standard
  70. output.
  71. .Bl -tag -width Ds
  72. .It Fl A
  73. Append to the specified archive.
  74. .It Fl a
  75. Reset the access times on files that have been copied to the
  76. archive.
  77. .It Fl B
  78. Set block size of output to 5120 bytes.
  79. .It Fl C Ar bytes
  80. Set the block size of output to
  81. .Ar bytes .
  82. .It Fl c
  83. Use ASCII format for
  84. .Nm
  85. header for portability.
  86. .It Fl F Ar archive
  87. Use the specified file as the input for the archive.
  88. .It Fl H Ar format
  89. Write the archive in the specified format.
  90. Recognized formats are:
  91. .Pp
  92. .Bl -tag -width sv4cpio -compact
  93. .It Ar bcpio
  94. Old binary
  95. .Nm
  96. format.
  97. .It Ar cpio
  98. Old octal character
  99. .Nm
  100. format.
  101. .It Ar pax
  102. POSIX pax format.
  103. .It Ar sv4cpio
  104. SVR4 hex
  105. .Nm
  106. format.
  107. .It Ar tar
  108. Old tar format.
  109. .It Ar ustar
  110. POSIX ustar format.
  111. .El
  112. .It Fl j
  113. Compress archive using the bzip2 format.
  114. The bzip2 utility must be installed separately.
  115. .It Fl L
  116. Follow symbolic links.
  117. .It Fl O Ar archive
  118. Use the specified file name as the archive to write to.
  119. .It Fl v
  120. Be verbose about operations.
  121. List filenames as they are written to the archive.
  122. .It Fl Z
  123. Compress archive using
  124. .Xr compress 1
  125. format.
  126. .It Fl z
  127. Compress archive using
  128. .Xr gzip 1
  129. format.
  130. .El
  131. .It Fl i
  132. Restore files from an archive.
  133. Reads the archive file from
  134. standard input and extracts files matching the
  135. .Ar patterns
  136. that were specified on the command line.
  137. .Bl -tag -width Ds
  138. .It Fl 6
  139. Process old-style
  140. .Nm
  141. format archives.
  142. .It Fl B
  143. Set the block size of the archive being read to 5120 bytes.
  144. .It Fl b
  145. Do byte and word swapping after reading in data from the
  146. archive, for restoring archives created on systems with
  147. a different byte order.
  148. .It Fl C Ar bytes
  149. Read archive written with a block size of
  150. .Ar bytes .
  151. .It Fl c
  152. Expect the archive headers to be in ASCII format.
  153. .It Fl d
  154. Create any intermediate directories as needed during
  155. restore.
  156. .It Fl E Ar file
  157. Read list of file name patterns to extract or list from
  158. .Ar file .
  159. .It Fl F Ar archive , Fl I Ar archive
  160. Use the specified file as the input for the archive.
  161. .It Fl f
  162. Restore all files except those matching the
  163. .Ar patterns
  164. given on the command line.
  165. .It Fl H Ar format
  166. Read an archive of the specified format.
  167. Recognized formats are:
  168. .Pp
  169. .Bl -tag -width sv4cpio -compact
  170. .It Ar bcpio
  171. Old binary
  172. .Nm
  173. format.
  174. .It Ar cpio
  175. Old octal character
  176. .Nm
  177. format.
  178. .It Ar pax
  179. POSIX pax format.
  180. .It Ar sv4cpio
  181. SVR4 hex
  182. .Nm
  183. format.
  184. .It Ar tar
  185. Old tar format.
  186. .It Ar ustar
  187. POSIX ustar format.
  188. .El
  189. .It Fl j
  190. Uncompress archive using the bzip2 format.
  191. The bzip2 utility must be installed separately.
  192. .It Fl m
  193. Restore modification times on files.
  194. .It Fl r
  195. Rename restored files interactively.
  196. .It Fl S
  197. Swap words after reading data from the archive.
  198. .It Fl s
  199. Swap bytes after reading data from the archive.
  200. .It Fl t
  201. Only list the contents of the archive, no files or
  202. directories will be created.
  203. .It Fl u
  204. Overwrite files even when the file in the archive is
  205. older than the one that will be overwritten.
  206. .It Fl v
  207. Be verbose about operations.
  208. List filenames as they are copied in from the archive.
  209. .It Fl Z
  210. Uncompress archive using
  211. .Xr compress 1
  212. format.
  213. .It Fl z
  214. Uncompress archive using
  215. .Xr gzip 1
  216. format.
  217. .El
  218. .It Fl p
  219. Copy files from one location to another in a single pass.
  220. The list of files to copy are read from standard input and
  221. written out to a directory relative to the specified
  222. .Ar directory
  223. argument.
  224. .Bl -tag -width Ds
  225. .It Fl a
  226. Reset the access times on files that have been copied.
  227. .It Fl d
  228. Create any intermediate directories as needed to write
  229. the files at the new location.
  230. .It Fl L
  231. Follow symbolic links.
  232. .It Fl l
  233. When possible, link files rather than creating an
  234. extra copy.
  235. .It Fl m
  236. Restore modification times on files.
  237. .It Fl u
  238. Overwrite files even when the original file being copied is
  239. older than the one that will be overwritten.
  240. .It Fl v
  241. Be verbose about operations.
  242. List filenames as they are copied.
  243. .El
  244. .El
  245. .Sh ENVIRONMENT
  246. .Bl -tag -width Ds
  247. .It Ev TMPDIR
  248. Path in which to store temporary files.
  249. .El
  250. .Sh EXIT STATUS
  251. The
  252. .Nm
  253. utility exits with one of the following values:
  254. .Pp
  255. .Bl -tag -width Ds -offset indent -compact
  256. .It 0
  257. All files were processed successfully.
  258. .It 1
  259. An error occurred.
  260. .El
  261. .Sh DIAGNOSTICS
  262. Whenever
  263. .Nm
  264. cannot create a file or a link when extracting an archive or cannot
  265. find a file while writing an archive, or cannot preserve the user
  266. ID, group ID, file mode, or access and modification times when the
  267. .Fl p
  268. option is specified, a diagnostic message is written to standard
  269. error and a non-zero exit value will be returned, but processing
  270. will continue.
  271. In the case where
  272. .Nm
  273. cannot create a link to a file,
  274. .Nm
  275. will not create a second copy of the file.
  276. .Pp
  277. If the extraction of a file from an archive is prematurely terminated
  278. by a signal or error,
  279. .Nm
  280. may have only partially extracted the file the user wanted.
  281. Additionally, the file modes of extracted files and directories may
  282. have incorrect file bits, and the modification and access times may
  283. be wrong.
  284. .Pp
  285. If the creation of an archive is prematurely terminated by a signal
  286. or error,
  287. .Nm
  288. may have only partially created the archive, which may violate the
  289. specific archive format specification.
  290. .Sh SEE ALSO
  291. .Xr pax 1 ,
  292. .Xr tar 1
  293. .Sh AUTHORS
  294. .An Keith Muller
  295. at the University of California, San Diego.
  296. .Sh CAVEATS
  297. Different file formats have different maximum file sizes.
  298. It is recommended that a format such as cpio or ustar
  299. be used for larger files.
  300. .Bl -column "File format" "Maximum file size" -offset indent
  301. .It Sy "File format" Ta Sy "Maximum file size"
  302. .It bcpio Ta "4 Gigabytes"
  303. .It sv4cpio Ta "4 Gigabytes"
  304. .It cpio Ta "8 Gigabytes"
  305. .\" XXX should be "unlimited"
  306. .It pax Ta "8 Gigabytes"
  307. .It tar Ta "8 Gigabytes"
  308. .It ustar Ta "8 Gigabytes"
  309. .El
  310. .Sh BUGS
  311. The
  312. .Fl s
  313. and
  314. .Fl S
  315. options are currently not implemented.