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

📄 tar.1

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 1
字号:
.\" SCCSID: @(#)tar.1	4.1	12/9/88.TH tar 1.SH Nametar \- multivolume archiver.SH Syntax.B tar[\|\fIkey\fR\|] [\|\fIname...\fR\|].SH Description.NXA "tar command" "mdtar command".NXA "tar command" "ar program".NXAM "tar command" "tar file".NXR "tar command".NXR "file" "backing up"The tape archiver command,.PN tar ,saves and restores multiple files to and from a single archive.The default archive device is .PN /dev/rmt0h ,but any file or device may be requested through the use of options..PPThe.I keyis a string of characters containing at most one functionletter and possibly names specifying which files to dump or restore.In all cases, appearance of a directory name refers to the files and(recursively) subdirectories of that directory..PPThis utility supports EOT handling which allows the use ofmultiple media.  The utility prompts for the next volume when itencounters the end of the current volume..SH Function Keys.NXR "tar command" "keys"The function portion of the key is specified by one ofthe following letters:.TP 8.B cCreate a new archive on tape, disk or file.Writing starts at the beginning of the archiveinstead of after the last file..TP 8.B rWrite the named files to the end of the archive..TP 8.B tList the names of the files as they occur on the input archive..TP 8.B uAdd the named files to the archive if they are notthere already or if they have been modified since they werelast put in the archive..TP 8.B xExtract the named files from the archive.If the named file matches a directory whose contentshad been written into the archive,the directory is recursively extracted.The owner, modification time,and mode are restored, if possible.If no file argument is given, the entire contentof the archive is extracted.Note that if multiple entries specifying the samefile are in the archive,the last one overwrites all previous versions extracted..SH Options.NXR "tar command" "options"You can use one or more of the following options inaddition to the letter which selects the functiondesired..TP 10.B 0...9Substitute number for the device unit number as in .PN /dev/rmt#h .The default is the high density rewindtape device number zero named .PN /dev/rmt0h .The command .EXtar cv4 tar.c.EEuses device .PN /dev/rmt4h ..TP 10.B AUse next argument as archive number with which to begin output..TP 10.B BForce input and output blocking to 20 blocks/record. This option allows.PN tarto work across a communications channel where the blocking may notbe maintained..TP 10.B DDirectory output in original .PN tarstyle..TP 10.B CUse to perform a directory change prior to archiving data..TP 10.B "\F[ F ]"Operate in .I fast mode .When.B \-Fis specified,.PN tarskips all SCCS directories, core files, and error files.When.B \-FFis specified,.PN taralso skips all.PN a.outand.B *.ofiles..TP 10.B HHelp mode.Print a summary of the function keys and options..TP 10.B MNext arg specifies maximum archive number to be written andprints current archive number on output line..TP 10.B NNo multi-archive, file splitting, or new header format on output.Output directories in previous tar format. On input, set fileUID & GID from file header vs. values in .PN /etc/passwdand group files..TP 10.B OInclude file owner & group names in verbose output (t & x functions)if present in archive header.  Output warning message if owneror group name not found in.PN /etc/passwdor.PN /etc/groupfile (cru functions)..TP 10.B PUsed to specify POSIX format tapes.Unnecessary with keys other than the \fBc\fR key..TP 10.B REach named file contains a list of file names separated by newlineswhich is added to (\fBc\fP function key) or extractedfrom (\fBx\fP function key) the archive..TP 10.B SOutput User Group Standard archive format..TP 10.B VDisplay extended verbose information.Included are the version number of.PN tar ,the number of blocks used on the device,the number of blocks in a file,and the protection modes given in a format similar to the.B ls.B \-lcommand.In addition to this information,.B Vprovides the information given by the.B voption..TP 10.B bUse the next argument as the blocking factor for tape records.The default is 20 (the maximum is 127).This option should only be used with raw magnetic tape archives (See the.B foption).The block size is determined automaticallywhen reading tapes (\fBx\fP and \fBt\fR)keys. See the \fBRestrictions\fP section. .TP 10.B dUse .PN /dev/rra1a as the default device.The .PN mdtarcommand is recommended for use with floppy disks..TP 10.B fUse the next argument as the name of the archive instead of/dev/rmt0h.If the name of the file is.B \- ,.PN tarwrites to standard output orreads from standard input,whichever is appropriate.Thus,.PN tarcan be used as the head or tail of a filter chain.You can also use.PN tarto move hierarchies.The following example shows how to move the directory.I fromdirto the directory.I todir :.EX# cd fromdir; tar cf \- . | (cd todir; tar xpf \-).EE.TP.B hSave a copy of the actual file on the output device under thesymbolic link name,instead of placing the symbolic information on the output.The default action of.PN taris to place symbolic link information on the output device.A copy of the file itself is not saved on the output device..TP.B iIgnore checksum errors found in the archive..TP 10.B lComplain if.PN tarcannot resolve all of the links to the files dumped.If this is not specified,no error messages are printed..TP 10.B mDo not restore the modification times.The modification time is the time of extraction.Tar normally restores modification times of regular andspecial files..TP 10.B oSuppress the normal directory information.  On output, .PN tarnormally places information specifying owner and modes of directories in the archive.  Former versions of .PN tar ,whenencountering this information will give error message of the form,.EX<name>/: cannot create.EE.PN tarwill place information specifying owner and modesof directories in the archive..TP 10.B pRestore the named files to their original modes,ignoring the present .MS umask 2 .Setuid and sticky bit informationis also restored to the superuser..TP 10.B sNext argument specifies size of archive in 512 byte blocks..TP 10.B vWrite the name of each file treated,preceded by the function letter,to diagnostic output.  Normally,.PN tardoes its work silently.With the.B tfunction key,the verbose option provides more information about thetape entries than just their names..EX#cd /#tar cvf tar-out vmunix.EEProduces the output ``a vmunix 1490 blocks'' where 1490 is the number of 512 byteblocks in the file ``vmunix''..EX#tar xvf tar-out.EEProduces the output ``x vmunix, 762880 bytes, 1490 blocks'' where 762880 is thenumber of bytes and 1490 is the number of 512 byte blocks in the file ``vmunix''which was extracted..TP 10.B wPrint the action to be taken, followed by file name,then wait for user confirmation.If a word beginning with the letter.B yis given,the action is done.Any other input means do not do it..SH Restrictions.NXR "tar command" "restricted"There is no way to ask for the.IR n\^\^thoccurrence of a file..PPTape errors are handled ungracefully..PPThe .B ukey can be slow..PPThe limit on file name length is 100 characters..PPThere is no way to follow symbolic links selectively..PPOn SCSI tape devices tar (when reading) may end on one volume of a multi-volume setwithout prompting for the next volume. This is a very infrequentcondition. The next volume should be loaded and the command issuedagain..PPUsing a blocking factor other than the default (\fBb\fP option) may lead to higher performance. However, you must select a value that is compatible with the hardware limitations of the source and destination machines. Software limitations may apply for other versions of .PN tar ..PPWhen extracting (\fBx\fP), .PN tarreads the entire tape. See the \fBr\fP and \fBu\fP keys..SH Examples.NXR(e) "tar command"To archive files from .PN /usr/includeand .PN /etc ,type:.EX# tar c \-C /usr/include . \-C /etc ..EE.PPThe.PN tarcommand can properly handle blocked archives..SH Diagnostics.NXR "tar command" "diagnostics"Indicates bad key characters and read/write errors..PPIndicates if enough memory is not available to hold the link tables..SH Files.br.PN /dev/rmt0h.br.PN /dev/rra1a.br.PN /tmp/tar*.SH See Alsomdtar(1), mt(1), tar(5)

⌨️ 快捷键说明

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