📄 cpio.1
字号:
.\" $Id: cpio.1,v 1.2 89/02/12 10:08:42 mark Exp $.TH CPIO 1 "USENIX Association" "".SH NAMEcpio \- copy file archives in and out.SH SYNOPSIS.B cpio.BR \-o [ Bacv ].br.B cpio.BR \-i [ Bcdfmrtuv ].RI [ pattern... ].br.B cpio.BR \-p [ adlmruv ].I directory.SH DESCRIPTIONThe.B cpioutility produces and reads files in the format specified by the.B cpio.B "Archive/Interchange File Format"specified in.IR "IEEE Std. 1003.1-1988" ..PPThe.B "cpio -i"(copy in) utility extracts files from the standard input, which isassumed to be the product of a previous.B "cpio -o" .Only files with names that match.I patternsare selected.Multiple.I patternsmay be specified and if no.I patternsare specified, the default for.I patternsis \*, selecting all files.The extracted files are conditionally created and copied into thecurrent directory, and possibly any levels below, based upon theoptions described below and the permissions of the files will be thoseof the previous.B "cpio -o" .The owner and group of the files will be that of the current userunless the user has appropriate privileges, which causes.B cpioto retains the owner and group of the files of the previous.B "cpio -o" ..PPThe .B "cpio -p"(pass) utility reads the standard input to obtain a list of path namesof files that are conditionally created and copied into thedestination.I directory based upon the options described below..PPIf an error is detected, the cause is reported and the.B cpioutility will continue to copy other files..B cpiowill skip over any unrecognized files which it encounters in the archive..PPThe following restrictions apply to the .B cpioutility:.IP 1 .25iPathnames are restricted to 256 characters..IP 2 .25iAppropriate privileges are required to copy special files..IP 3 .25iBlocks are reported in 512-byte quantities..SS OptionsThe following options are available:.TP .5i.B \-BInput/output is to be blocked 5120 bytes to the record.Can only be used with.B "cpio -o" or.B "cpio -i"for data that is directed to or from character special files..TP .5i.B \-aReset access times of input files after they have been copied.When the.B \-loption is also specified, the linked files do not have their accesstimes reset.Can only be used with.B "cpio -o"or.B "cpio -i" ..TP .5i.B \-cWrite header information in ASCII character for for portability.Can only be used with.B "cpio -i"or.B "cpio -o" .Note that this option should always be used to write portable files..TP .5i.B \-dCreates directories as needed.Can only be used with .B "cpio -i" or.B "cpio -p" ..TP .5i.B \-fCopy in all files except those in.I patterns .Can only be used with.B "cpio -i" ..TP .5i.B \-lWhenever possible, link files rather than copying them.Can only be used with .B "cpio -p" ..TP .5i.B \-mRetain previous modification times.This option is ineffective on directories that are being copied.Can only be used with.B "cpio -i" or.B "cpio -p" ..TP .5i.B \-rInteractively rename files.The user is asked whether to rename.I patterneach invocation.Read and write permissions for.B "/dev/tty"are required for this option.If the user types a null line, the file is skipped.Should only be used with.B "cpio -i"or.B "cpio -o" ..TP .5i.B \-tPrint a table of contents of the input.No files are created.Can only be used with.B "cpio -i" ..TP .5i.B \-uCopy files unconditionally; usually an older file will not replace anew file with the same name.Can only be used with.B "cpio -i"or.B "cpio -p" ..TP .5i.B \-vVerbose: cause the names of the affected files to be printed.Can only be used with.B "cpio -i" .Provides a detailed listing when used with the .B \-toption..SS OperandsThe following operands are available:.TP 1i.I patternsSimple regular expressions given in the name-generating notation of theshell..TP 1i.I directoryThe destination directory..SS "Exit Status"The.B cpioutility exits with one of the following values:.TP .5i0All input files were copied..TP .5i2The utility encountered errors in copying or accessing files ordirectories.An error will be reported for nonexistent files or directories, orpermissions that do not allow the user to access the source or targetfiles..SSIt is important to use the.B "-depth"option of the.B findutility to generate pathnames for .B cpio .This eliminates problems.B cpiocould have trying to create files under read-only directories..PPThe following command:.RSls | cpio -o > ../newfile.REcopies out the files listed by the .B lsutility and redirects them to the file.B newfile ..PPThe following command:.RScat newfile | cpio -id "memo/al" "memo/b*".REuses the output file.B newfilefrom the.B "cpio -o"utility, takes those files that match the patterns.B "memo/al"and.B "memo/b*" ,creates the directories below the current directory, and places thefiles in the appropriate directories..PPThe command.RSfind . -depth -print | cpio -pdlmv newdir.REtakes the file names piped to it from the.B findutility and copies or links those files to another directorynamed.B newdir ,while retaining the modification time..SH FILES.TP 1i/dev/ttyused to prompt the user for information when the.B \-i or .B \-roptions are specified..SH "SEE ALSO"find(1), pax(1), tar(1), cpio(5), tar(5).SH COPYRIGHTCopyright (c) 1989 Mark H. Colburn. .brAll rights reserved..PPRedistribution and use in source and binary forms are permittedprovided that the above copyright notice is duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by Mark H. Colburn and sponsored by The USENIX Association. .PPTHE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE..SH AUTHORMark H. Colburn.brNAPS International.br117 Mackubin Street, Suite 1.brSt. Paul, MN 55102.brmark@jhereg.MN.ORG.sp 2Sponsored by.B "The USENIX Association"for public distribution.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -