cpio.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 288 行

1
288
字号
.\" SCCSID: @(#)cpio.1	8.2	4/10/91.TH cpio 1.SH Namecpio \- copy file archives in and out.SH Syntax.B cpio.B \-i \fR[ \fB\-C\fR ]  [\|\fIkeys\fR\|][\|\fIpatterns\fR\|] .PP.B cpio.B \-o[\|\fIkeys\fR\|].PP.B cpio.B \-p[\|\fIkeys\fR\|].I directory.SH Description.NXR "cpio command".NXR "archive file" "copying".NXR "cpio command" "ar command"The .PN cpiocommand is a filter designed to let you copy files to or from anarchive.  The.PN cpio commanddiffers from the.PN arcommand in that.PN cpiolets you archive any kind of file, while.PN aris limited to program object files..SH Options.NXR "cpio command" "options".TP 5.B \-iCopies files that match the specified pattern.  If the pattern is not specified,copies in all files.Extracts files from thestandard input,which is assumed to be the product of a previous.BR "cpio \-o" ,and places them into the user's current directory tree.For files with the same name, the newer file replacesthe older file unless the \fB\-u\fR option is used..sp.RS 5Only files with names that match.I patterns\^are selected.The.I patterns\^are specified using the notation for names describedin .MS sh 1 .In.I patterns,the slash for directories (/) is included in searches usingmeta-characters.For example, suppose the archive contains the file.PN filep and the pathname information in the archive indicatesthat the directory below contains the file .PN file2p .This command copies both files into the user's current directory:.EXcpio \-i *p < /dev/rmt0l.EE.PPMultiple.I patterns\^may be specified andif no.I patterns\^are specified, the default for.I patterns\^is.BR \(**(that is, select all files).The extracted files are conditionally created and copiedinto the current directory treebased upon the options described below.The .PN cpiocommand has three function keys, each with its own setof options..RE.TP 5.B \-CSpecifies compatability mode for reading .PN cpio archives created with the old style header format.  Use this option tocopy in .PN cpio archives generated by pre-V4.2 .MS cpio 1 .Thisoption is valid only for copy-in (\fB\-i\fR) operations..TP 5.B \-oCopies out the specified files.  Reads the standard input to obtain a list of path names and copies those files onto the standard outputtogether with path name and status information..TP.B \-pCopies files into the specified destination directory, which must already exist.Reads the standard input to obtain a list of path namesof files that are conditionally created.  This list offiles is copied into the destination.I directorytree based upon the options used.  For files with thesame name, the newer file replaces the older file unlessthe \fB\-u\fR option is used..SH Keys.NXR "cpio command" "function keys".TP 5.B 6Processes a file with the UNIXSystemSixthEdition format..TP.B aRetains original access times of input files, and can be used with.B \-oand .B \-p.  Normally, the read(s) used in the copy update the copied file's access time..TP.B BDetermines input/output is to be blocked 5,120 bytes to the record.This option is meaningful only with data directed to or from.PN /dev/rmt?hor.PN /dev/rmt?l ..TP.B bSwaps both bytes and halfwords..TP.B cCreates header information in ASCII format and can be used with.B \-iand .B \-o..TP.B dCreates subdirectories, as needed, below the specifieddestination directory..TP.B fCopies all files except those that match the specified pattern.  .TP.B kEnables symbolic link handling and is used with the .B \-i,.B \-o,and.B \-poptions..TP.B lCreates links wherever possible.  .TP.B mRetains modification time for each copied file.  This option doesnot work on directories or symbolic linksthat are being copied; the directoryis always reset to show the access time when the copy was made..TP.B rInteractivelyrenamesfiles.If you respond with a null line, thefile is skipped (not copied).  Use only with the \fB\-i\fRoption..TP.B sSwaps bytes while copying files in..TP.B SSwaps half words while copying files in.  .TP.B tPrints atable of contentsof the input (no files are created)..TP.B uCopies files unconditionally.  (Otherwise, an older file will not replace a newer file with the same name)..TP.B vDisplays detailed (verbose) information as it copies and/or creates file.  When used withthe.B toption,the table of contents looks like the output of an.B ls\ \|\-lcommand.  For further information,see.MS ls 1 ..SH Examples.NXR "cpio command"This example shows how to copy the contents of the user'scurrent directoryinto an archive..EXls | cpio \-o  > /dev/rmt0l.EEThis example shows how to duplicate a directory hierarchy..EXmkdir ~phares/newdircd ~phares/olddirfind . \-print | cpio \-pdl ~phares/newdir.EEThis example shows how to copy all files and directorieswith names containing the characters "chapter" in user smith'shome directory and underlying directories..EXfind ~smith \-name '*chapter*' \-print | cpio \-o > /dev/rmt0h.EEThis example shows the results of using the \fBr\fRoption with the \fB\-i\fR function key..EXls | cpio \-ir > ~smith/newdirRename <file1>newnamefile1Rename <file2><RETURN>SkippedRename <file3>newnamefile3.EEIn some cases, the \fB\-cpio\fR option of the.PN findcommand can be used more effectively than pipes andredirects using.PN cpio.  For instance, the following example.EX find . \-print | cpio \-oB > /dev/rmt0l.EEcan be handled more efficiently by:.EXfind . \-cpio /dev/rmt0l.EETo copy the contents of a directory (with symbolic link handlingenabled) to the tape drive, type:.EXls | cpio \-ok > /dev/rmt0h.EETo restore the archived files back into a directory, type:.EXcpio \-ik < /dev/rmt0h.EEThe following example moves files, including symbolic links, from an old directory to a new directory:.EXmkdir ~craig/newdircd ~craig/olddirls | cpio \-pdk ~craig/newdir.EE.SH Restrictions.NXR "cpio command" "restricted"Pathnames are restricted to 128 characters..PPWhen there are too many unique linked files,the program runs out ofmemory and cannot trace them.  In this case, linking information is lost..PPOnly the superuser can copy special files..SH See Alsoar(1), find(1), cpio(5).NXR "cpio command".NXR "archive file" "copying"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?