pxtar.1
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 453 行
1
453 行
.\" Copyright (c) 1990, Digital Equipment Corporation.\" This material based on work....\" Copyright (c) 1990, OPEN SOFTWARE FOUNDATION, INC..\" ALL RIGHTS RESERVED.TH pxtar 1.SH Namepxtar \- manipulates tape archives.SH Syntax.B pxtar.RB [ \-c|.B \-r|.B \-t|.B \-u|.BR \-x ].RB [ \-BdFhilmMpsvw ] .RB [ \-\c.IR number ].RB [ b\c.IR blocks ].RB [ \-C\c.I directory\fP\&.\&.\&.].RB [ \-f\c.IR file ].RB [ \-L\c.IR inputlist ].RB [ \-N\c.IR blocks ].RB [ \-S.IB blocks b|.B \-S .I feet|.B \-S .I feet .BI @ density\c].RI [ file\&.\&.\&.].SH Description.NXR "tape archiver".NXR "pxtar command".NXR "files" "archival storage".NXR "archival storage"The .PN pxtarcommand writes files to or retrieves files from an archive storage medium or an archive file.The .PN pxtar command looks for archives onthe default device (usually tape), unless youspecify another device or archive file with the \fB\-f\fP option..PPFilenames must not be longer than257 characters and must not contain spaces. Characters following thefirst space are ignored.Internally, the filename may be split into two pieces to fit into theheader block.For more details,see Issue 3 of the \fIX/Open\fP\*(TM\fI Portability Guide\fP, \"TITLE_EXEMPT\"\fIVolume 3\fP, \fIXSI Supplementary Definitions\fP, section 18.5. \"TITLE_EXEMPT\".PPWhen writing to an archive, .PN pxtaruses a temporary file.Pn ( /tmp/tar* )and maintains in memory a table of files withseveral links. You will receive an error message if .PN pxtarcannot create the temporary file, or if there is not enough memoryavailable to hold the link tables..SH Function KeysYou must supply one of the following five function keys tocontrol the actions of .PN pxtar :.TP 5\fB\-c\fPCreates a new archive andwrites the files at the beginning of the archive. .TP\fB\-r\fPWrites the file at the end of the archive..TP\fB\-t\fPLists the files in the order in which they appearin the archive. Files may appear more than once..TP\fB\-u\fPAdds file to the end of thearchive only if it is not in thearchive already or if it has been modified since it was written to thearchive. .TP\fB\-x\fPExtracts file from the archive. If you specify a directory,.PN pxtarextracts all files in that directory from the archive.If you do not specify a file or a directory,.PN pxtarextracts all of the files from the archive.When an archive contains multiple copies of the same file,.PN pxtarextracts only the last one and overwrites allearlier ones. If you have superuser authority (see the .MS su 1reference page),.PN pxtarcreates all files and directories with the same user andgroup IDs as on the tape. If you do not have superuser authority,the files and directories have your user and group IDs..SH OptionsThe options to .PN pxtarare listed below.In all cases, a directory argument refers to all thefiles and subdirectories, recursively, within that directory.Options without corresponding arguments may appear separately or begrouped together. Options that take arguments may have them adjacentto the option letter or as the entire following argument.The \fB\-b\fR, \fB\-C\fR, \fB\-S\fR, and \fB\-f\fR options can acceptoptional spaces before their arguments..TP 5\fB\-b\fP\fIblocks\fPSpecifies the number of 512-byte blocks per record.The default is 20, which is appropriate for tape records.(The maximum is also 20.) Due to the size of inter-record gaps, tapes written with large blocking factors can hold much more data thantapes with only one block per record..sp .5 The block size is determined automatically when tapes are read(function keys \fB\-x\fP or \fB\-t\fP). When archives areupdated with the \fB\-u\fP and \fB\-r\fP functions, the existingrecord size is used. The .PN pxtarcommand writes archives usingthe specified \fIblocks\fP value only when creating new archiveswith the \fB\-c\fP flag..sp .5 For output to ordinary files with the \fB\-f\fP option, you cansave disk space by using a blocking factor that matches the size of diskblocks (for example, \fB\-b4\fP for 2048-byte disk blocks).Ordinary files must be read using the same blocking factor used whenthey were created..TP\fB\-B\fPForces input and output blocking to 20 blocks per record.This option was added so that .PN pxtarcan work acrosscommunications channels where the blocking may not bemaintained..TP\fB\-C\fP\fIdirectory\fRPerforms a .PN chdirto a \fIdirectory\fR preceded by \fB\-C\fP. This allowsmultiple directories not related by a close common parent to bearchived using short relative pathnames. For example, toarchive files from .PN /usr/includeand .PN /etc , one might use the following command:.IP\ % \fBpxtar c \-C/usr/include \-C/etc\fR.TP\fB\-d\fPSuppress separate entries for directories, blocks and characterspecial files, and FIFOs (First In First Out piped processes).When this option is specified, .PN pxtarwrites only ordinaryfiles to an archive, and extracts only ordinary files and the directoriesrequired to contain them as determined by the pathnames in the archive.Normally, .PN pxtarpreserves the directory permission codes and restores emptydirectories, special files, and FIFOs with the \fB\-x\fP flag..TP\fB\-f\fIfile\fP\fPUses \fIfile\fP as the archive to be read or written. Whenthis option is not specified,.PN pxtaruses a system-dependent default filename of theform \f(CW/dev/rmt?h\fR(usually \f(CW/dev/rmt0h\fR).If the file specified is\fB\-\fR (minus), .PN pxtarwrites to standard output or readsfrom standard input.When writing to standard output, only the \fB\-c\fPflag can be used (\fB\-r\fP or \fB\-u\fP cannot be used). .TP\fB\-F\fPChecks the file type before archiving. SCCS, RCS, core, errorfiles, filenames ending in .PN \&.oand .PN a\&.outfiles willnot be archived..TP\fB\-h\fPForces .PN pxtarto follow symbolic linksas if they were normal files or directories. Normally,.PN pxtardoes not follow symbolic links..TP\fB\-i\fPIgnores header checksum errors. The .PN pxtarcommandwrites a file header containing a checksum for each filein the archive. When this option is not specified, the systemverifies the contents of the header blocks byrecomputing the checksum, and aborts with a \fB`directory checksumerror'\fR when a mismatch occurs. When this option is specified,.PN pxtarlogs the error and then scans forward until it finds a validheader block. This permits restoring files from later volumes of amulti-volume archive without reading earlier volumes..TP\fB\-l\fPWrites error messages to standard output if .PN pxtarcannotresolve all of the links to the files archived.When you do not specify this option, the system does not display thesemessages..TP\fB\-L\fP\fIinputlist\fPWrites the files listed in the \fIinputlist\fP file to thearchive. \fIinputlist\fP should contain one filename per line. Filesand directories from \fIinputlist\fR are treated recursively. If you includethe name of a directory in \fIinputlist\fR, .PN pxtarcommand writesthe directory to the archive as well as the files and subdirectoriesto the archive. If you also list files or directories on the command line, the contents of\fIinputlist\fP are included after .PN pxtarhas written allthe files or the directories and their subdirectories to the archive..TP\fB\-m\fPUses the time of extraction as the modification time.The default is to preserve the modification time of the files..TP\fB\-M\fPInstructs .PN pxtarnot to cross mount points.The default is to cross mount points..TP\fB\-N\fP\fIblocks\fPAllows .PN pxtarto use very large clusters of blocks when itdeals with streaming tape archives. Note, however, that on input,.PN pxtarcannot automatically determine the block size of tapeswith very long block sizes created with this option. In the absence of a\fB\-N\fP\fIblocks\fP argument, the largest block size that .PN pxtarcan automatically determine is 20 blocks..TP\fB\-p\fPRestores files to their original modes,ignoring the present \fIumask\fP. "Set user ID" and stickyinformation will also be restored when extracted by the superuser..TP\fB\-s\fPTries to create a symbolic link if .PN pxtarfails in its attempt to link (regular link) two files. .TP.PD 0\fB\-S \fIblocks\fBb\fP.TP\fB\-S \fIfeet\fP.TP.PD\fB\-S \fIfeet \fB@\fP\fIdensity\fPSpecifies the number of 512-byte \fIblocks\fP per volume (firstformat), independent of the tape blocking factor. You can also specifythe size of the tape in feet by using the second form, and .PN pxtarassumes a default density. The third form allows you tospecify both tape length and density. Feet are assumed to be 11 incheslong to be conservative. This option lets you deal more easily withmulti-volume tape archives, where .PN pxtarmust be able todetermine how many blocks fit on each volume..sp .5Note that tape drives vary in density capabilities. The\fIdensity\fP argument calculates the amount of data a system canfit on a tape. This allows the correct amount of data to bewritten to a tape..TP\fB\-v\fPLists the name of each file as it is processed. Withthe \fB\-t\fP flag, \fB\-v\fP gives more informationabout the tape entries, including file sizes, times of last modification,UID, and GID, and permissions..TP\fB\-w\fPDisplays the action to be taken followed by the filename, then waitsfor user confirmation. If the response begins with \fBy\fRor \fBY\fR, the action is performed; otherwise, the file is ignored..TP\fB\-\fInumber\fRUses \fB/dev/rmt\fInumber\fPh\fRinstead of the default. Forexample, \fB\-2\fR is the same as \fB\-f/dev/rmt2h\fR.The default unit is \fB/dev/rmt0h\fR..SH RestrictionsThere is no way to ask for any occurrence of a file other than the last..PPThere is no recovery from tape errors. .PPAlthough anyone can archive special files, only a user withsuperuser authority can extract them from an archive..PPDo notreplace .PN /bin/tar with .PN pxtar .Although the .PN /bin/tar and .PN pxtarcommands have much in common, they arenot interchangeable. The .PN pxtarcommand providescompatibility and interoperability with XPG3 systems; .PN pxtar is notintended as a replacement for .PN /bin/tar . The .PN /bin/tarcommand addstape-label information to a tape archive, so .PN /bin/tar and .PN pxtarhavedifferent formats for multiple-volume archives. The .PN /bin/tarcommand hasseveral added switches that enable features used in the installationprocess and by .PN setld . Substituting the.PN pxtar for the.PN /bin/tarcauses the.PN setld command to fail; other commands may also be affected. .SH Examples.IP \fR1. To write \fIfile1\fR and \fIfile2\fR to a new archiveon the default tape drive:.IP\ % \fBpxtar \-c \fIfile1 file2\fR.IP \fR2. To extract all files that are in the .PN /tmpdirectory fromthe archive file on the tape device .PN /dev/rmt2and use the timeof extraction as the modification time:.IP\ % \fBpxtar \-xm \-f/dev/rmt2 /tmp\fR.IP \fR3. To create a new archive file that contains \fIfile1\fR andpass the archive file to the .PN ddcommand to be written tothe device .PN /dev/rmt1 :.IP\ % \fBpxtar \-cvf \- \fIfile1\fP \(or dd of=/dev/rmt1\fR.IP \fR4. To display the names of the files in the disk archive file.PN out.taron the current directory:.IP\ % \fBpxtar \-vtf out\&.tar\fR.IP \fR5. To expand the compressed archive file .PN fil.tar.z ,pass the file to the .PN pxtarcommand, and extract all filesfrom the expanded archive file:.IP\ % \fBpcat fil\&.tar\&.z \(or pxtar \-xvf \-\fR.SH Compatibility NotesMulti-volume archives created by .PN pxtarare not interchangeablewith multi-volume archives created by .PN tar ;single-volume archives are interchangeable..PPThe .PN pxtarutility produces archives that follow the format requirements specified in the IEEE 1003.1-1988 (\fIPOSIX\fP) standardand the \fIX/Open Portability Guide, Issue 3\fP. \"TITLE_EXEMPT\".SH Diagnostics\fBdirectory checksum error\fR .brThe \fB\-i\fP option was not specified, and a checksum error occurred..SH Files.PD 0.TP 20.PN /usr/bin/pxtarCommand path..TP.PN /dev/rmt0Default archive name..TP.PD.PN /tmp/tar*Temporary archive file..SH See Alsocat(1), dd(1)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?