⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pax.1

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 1
字号:
.\" $Id: pax.1,v 1.2 89/02/12 10:08:47 mark Exp $.TH PAX 1 "USENIX Association" "".SH NAMEpax \- portable archive exchange .SH SYNOPSIS.TP \w'\fBpax\fR\ 'u.B pax.RB [ \-cimopuvy ].RI "[\fB\-f\fR" " archive" ].RI "[\fB\-s\fR" " replstr" ].RI "[\fB\-t\fR" " device" ] .RI [ pattern... ].TP \w'\fBpax\ \-r\fR\ 'u.B "pax\ \-r".RB [ \-cimnopuvy ].RI "[\fB\-f\fR" " archive" ].RI "[\fB\-s\fR" " replstr" ] .RI "[\fB\-t\fR" " device" ] .RI [ pattern... ].TP \w'\fBpax\ \-w\fR\ 'u.B "pax\ \-w".RB [ \-adimuvy ] .RI "[\fB\-b\fR" " blocking" ].RI "[\fB\-f\fR" " archive" ] .RI "[\fB\-s\fR" " replstr" ] .RI "[\fB\-t\fR" " device" ] .RI "[\fB\-x\fR" " format" ].RI [ pathname... ].TP \w'\fBpax\ \-rw\fR\ 'u.B "pax\ \-rw".RB [ \-ilmopuvy ] .RI "[\fB\-s\fR" " replstr" ] .RI [ pathname... ]directory.SH DESCRIPTION.I Pax reads and writes archive files which conform to the .B "Archive/Interchange File Format" specified in .IR "IEEE Std. 1003.1-1988" ..I Paxcan also read, but not write, a number of other file formatsin addition to those specified in the .B "Archive/Interchange File Format"description.Support for these traditional file formats, such as V7 .I "tar" and System V binary .I "cpio" format archives,is provided for backward compatibility and to maximize portability..PP.I Pax will also support traditional .I cpio and System V.I tarinterfaces if invoked with the name"cpio" or "tar" respectively.See the .I cpio(1) or .I tar(1)manual pages for more details..PPCombinations of the.B \-r and .B \-wcommand line arguments specify whether .I pax will read, write or list the contents of the specified archive,or move the specified files to another directory..PPThe command line arguments are:.TP .5i.B \-wwrites the files and directories specified by .I pathnameoperands to the standard output together with the pathname and status information prescribed by the archive format used.A directory.I pathnameoperand refers to the files and (recursively) subdirectories of that directory.If no .I pathname operands are given, then the standard input is read to get alist of pathnames to copy, one pathname per line.In this case, only those pathnames appearing on the standard input arecopied..TP .5i.B \-r.I Paxreads an archive file from the standard input.Only files with names that match any of the .I patternoperands are selected for extraction.The selected files are conditionally created and copied relative to thecurrent directory tree, subject to the options described below.By default, the owner and group of selected files will be that of theinvoking process, and the permissions and modification times will be thesames as those in the archive..RS .5i.PPThe supported archive formats are automatically detected on input.The default output format is .IR ustar ,but may be overridden by the .B \-x.I formatoption described below..RE.TP .5i.B \-rw.I Pax reads the files and directories named in the.I pathnameoperands and copies them to the destination .IR directory .A directory.I pathname operand refers to the files and (recursively) subdirectories of thatdirectory.If no .I pathnameoperands are given, the standard input is read to get a list of pathnamesto copy, one pathname per line.In this case, only those pathnames appearing on the standard input arecopied.The directory named by the .I directoryoperand must exist and have the proper permissions before the copy canoccur..PPIf neither the.BR \-r " or " \-w options are given, then .I paxwill list the contents of the specified archive.In this mode, .I pax lists normal files one per line, hard link pathnames as.sp.RS 1i.IR pathname " == " linkname.RE.spand symbolic link pathnames (if supported by the implementation) as.sp.RS 1i.IR pathname " -> " linkname.RE.spwhere .I pathnameis the name of the file being extracted, and.I linknameis the name of a file which appeared earlier in the archive..PPIf the .B \-voption is specified, then .I pax list normal pathnames in the same format used by the .I lsutility with the.B \-loption.Hard links are shown as.sp.RS 1i.IR "<ls -l listing>" " == " linkname.RE.spand symbolic links (if supported) are shown as.sp.RS 1i.IR "<ls -l listing>" " -> " linkname.RE.sp .PP.I Pax is capable of reading and writing archives which span multiple physical volumes.Upon detecting an end of medium on an archive which is not yet completed,.I pax will prompt the user for the next volume of the archive and will allow the user to specify the location of the next volume..SS OptionsThe following options are available:.TP 1i.B \-aThe files specified by.I pathnameare appended to the specified archive..TP 1i.BI \-b " blocking"Block the output at.I blockingbytes per write to the archive file.A .B ksuffix multiplies .I blocking by 1024, a.B b suffix multiplies .I blocking by 512 and a .B msuffix multiplies .I blocking by 1048576 (1 megabyte).For machines with 16-bit int's (VAXen, XENIX-286, etc.), the maximum buffer size is 32k-1.If not specified,.I blocking is automatically determined on input and is ignored for .B \-rw..TP 1i.B \-cComplement the match sense of the .I patternoperands..TP 1i.B \-dIntermediate directories not explicitly listed in the archive are not created.This option is ignored unlessthe .B \-roption is specified..TP 1i.BI \-f " archive"The.I archiveoption specifies the pathname of the input or output archive,overriding the default of standard input for .B \-ror standard output for.BR \-w ..TP 1i.B \-iInteractively rename files.Substitutions specified by .B \-soptions (described below)are performed before requesting the new file name from the user.A file is skipped if an empty line is entered and.I paxexits with an exit status of 0 if .B EOF is encountered..TP 1i.B \-lFiles are linked rather than copied when possible..TP 1i.B \-mFile modification times are not retained..TP 1i.B \-nWhen .B \-ris specified, but.B \-wis not, the .I patternarguments are treated as ordinary file names.Only the first occurrence of each of these files in the input archiveis read.The.B paxutility exits with a zero exit status after all files in the list have beenread.If one or more files in the list is not found,.B paxwrites a diagnostic to standard error for each of the files and exits witha non-zero exit status.the file names are compared before any of the .BR \-i ,.BR \-s ,or.B \-yoptions are applied..TP 1i.B \-oRestore file ownership as specified in the archive.The invoking process must have appropriate privileges to accomplish this..TP 1i.B \-pPreserve the access time of the input files after they have been copied..TP 1i.BI \-s " replstr"File names are modified according to the substitution expression using the syntax of .I "ed(1)"as shown:.sp.RS 2i-s /\fIold\fR/\fInew\fR/\fB[\fRgp\fB]\fR.RE.RS 1i.PPAny non null character may be used as a delimiter (a / is used here as anexample).Multiple .B \-sexpressions may be specified; the expressions are applied in the orderspecified terminating with the first successful substitution.The optional trailing .B pcauses successful mappings to be listed on standard error.The optional trailing.B gcauses the .I old expression to be replaced each time it occurs in the source string.Files that substitute to an empty string are ignored both on input andoutput..RE.TP 1i.BI \-t " device"The.I deviceoption argument is an implementation-defined identifier that names the inputor output archive device, overriding the default of standard input for.B \-rand standard output for.BR \-w ..TP 1i.B \-uCopy each file only if it is newer than a pre-existing file with the samename.This implies .BR \-a ..TP 1i.B \-vList file names as they are encountered.Produces a verbose table of contents listing on the standard output when both .B \-r and.B \-ware omitted,otherwise the file names are printed to standard error as they areencountered in the archive..TP 1i.BI \-x " format"Specifies the output archive.IR format .The input format, which must be one of the following, is automaticallydetermined when the.B \-r option is used.The supported formats are:.RS 1i.TP 0.75i.I cpioThe extended .I CPIOinterchange format specified in.B "Extended CPIO Format" in .I "IEEE Std. 1003.1-1988.".TP 0.75i.I ustarThe extended .I TARinterchange format specified in.B "Extended TAR Format" in .I "IEEE Std. 1003.1-1988."This is the default archive format..RE.TP 1i.B \-yInteractively prompt for the disposition of each file.Substitutions specified by .B \-soptions (described above)are performed before prompting the user for disposition..B EOFor an input line starting with the character.B qcaused.I paxto exit.Otherwise, an input line starting with anything other than .B ycauses the file to be ignored.This option cannot be used in conjunction with the .B \-i option..PPOnly the last of multiple .B \-f or.B \-toptions take effect..PPWhen writing to an archive, thestandard input is used as a list of pathnames if no.I pathnameoperands are specified.The format is one pathname per line.Otherwise, the standard input is the archive file,which is formatted according to one of the specifications in.B "Archive/Interchange File format"in .IR "IEEE Std. 1003.1-1988" ,or some other implementation-defined format..PPThe user ID and group ID of the process, together with the appropriateprivileges, affect the ability of .I paxto restore ownership and permissions attributes of the archived files.(See .I "format-reading utility"in.B "Archive/Interchange File Format"in .IR "IEEE Std. 1003.1-1988" ".)".PPThe options.BR \-a ,.BR \-c ,.BR \-d ,.BR \-i ,.BR \-l ,.BR \-p ,.BR \-t ,.BR \-u ,and.BR \-y are provided for functional compatibility with the historical.I cpioand.I tarutilities.The option defaults were chosen based on the most common usage of theseoptions, therefore, some of the options have meanings different thanthose of the historical commands..SS OperandsThe following operands are available:.TP 1i.I directoryThe destination directory pathname for copies when both the.B \-rand .B \-woptions are specified.The directory must exist and be writable before the copy or and errorresults..TP 1i.I pathnameA file whose contents are used instead of the files named on the standardinput.When a directory is named, all of its files and (recursively) subdirectoriesare copied as well..TP 1i.IR pattern A.I patternis given in the standard shell pattern matching notation.The default if no .I pattern is  specified is.BR * \,which selects all files..SH EXAMPLESThe following command.sp.RS 1ipax \-w \-f /dev/rmt0 \..RE.spcopies the contents of the current directory to tape drive 0..PPThe commands.sp.RS 1i.RI mkdir " newdir".br.RI cd " olddir".br.RI "pax -rw . " newdir.RE.spcopies the contents of .I olddir to .I newdir ..PPThe command.sp.RS 1ipax \-r \-s ',//*usr//*,,' -f pax.out.RE.spreads the archive .B pax.outwith all files rooted in "/usr" in the archive extractedrelative to the current directory..SH FILES.TP 1i/dev/ttyused to prompt the user for information when the.BR \-i " or " \-yoptions are specified. .SH "SEE ALSO"cpio(1), find(1), tar(1), cpio(5), tar(5).SH DIAGNOSTICS.I Paxwill terminate immediately, without processing any additional files on the command line or in the archive..SH "EXIT CODES".I Pax will exit with one of the following values:.IP 0 .5iAll files in the archive were processed successfully..IP ">0" .5i.I Pax aborted due to errors encountered during operation..SH BUGSSpecial permissions may be required to copy or extract special files..PPDevice, user ID, and group ID numbers larger than 65535 cause additionalheader records to be output.These records are ignored by some historical version of.I "cpio(1)"and.IR "tar(1)" ..PPThe archive formats described in.B "Archive/Interchange File Format" have certain restrictions that havebeen carried over from historical usage.For example, there are restrictions on the length of pathnames stored inthe archive..PPWhen getting an "ls -l" style listing on.I tarformat archives, link counts are listed as zero since the .I ustararchive format does not keep link count information..PPOn 16 bit architectures, the largest buffer size is 32k-1.This is due, in part, to using integers in the buffer allocation schemes,however, on many of these machines, it is not possible to allocate blocksof memory larger than 32k..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.brMinnetech Consulting, Inc..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 + -