.TH TAR 1 "31 October 1986" .SH NAME tar \- tape (or other media) file archiver .SH SYNOPSIS \fBtar\fP \-[\fBBcDhikmopstvxzZ\fP] [\fB\-b\fP \fIN\fP] [\fB\-f\fP \fIF\fP] [\fB\-T\fP \fIF\fP] [ \fIfilename\fP\| .\|.\|. ] .SH DESCRIPTION \fItar\fP provides a way to store many files into a single archive, which can be kept in another Unix file, stored on an I/O device such as tape, floppy, cartridge, or disk, or piped to another program. It is useful for making backup copies, or for packaging up a set of files to move them to another system. .LP \fItar\fP has existed since Version 7 Unix with very little change. It has been proposed as the standard format for interchange of files among systems that conform to the P1003 ``Portable Operating System'' standard. .LP This version of \fItar\fP supports the extensions which were proposed in the P1003 draft standards, including owner and group names, and support for named pipes, fifos, and block and character devices. .LP When reading an archive, this version of \fItar\fP continues after finding an error. Previous versions required the `i' option to ignore checksum errors. .SH OPTIONS \fItar\fP options can be specified in either of two ways. The usual Unix conventions can be used: each option is preceded by `\-'; arguments directly follow each option; multiple options can be combined behind one `\-' as long as they take no arguments. For compatability with the Unix \fItar\fP program, the options may also be specified as ``keyletters,'' wherein all the option letters occur in the first argument to \fItar\fP, with no `\-', and their arguments, if any, occur in the second, third, ... arguments. Examples: .LP Normal: tar -f arcname -cv file1 file2 .LP Old: tar fcv arcname file1 file2 .LP At least one of the \fB\-c\fP, \fB\-t\fP, or \fB\-x\fP options must be included. The rest are optional. .LP Files to be operated upon are specified by a list of file names, which follows the option specifications (or can be read from a file by the \fB\-T\fP option). Specifying a directory name causes that directory and all the files it contains to be (recursively) processed. In general, specifying full path names when creating an archive is a bad idea, since when the files are extracted, they will have to be extracted into exactly where they were dumped from. Instead, \fIcd\fP to the root directory and use relative file names. .IP "\fB\-b\fP \fIN\fP" Specify a blocking factor for the archive. The block size will be \fIN\fP x 512 bytes. Larger blocks typically run faster and let you fit more data on a tape. The default blocking factor is set when \fItar\fP is compiled, and is typically 20. There is no limit to the maximum block size, as long as enough memory can be allocated for it, and as long as the device containing the archive can read or write that block size. .IP \fB\-B\fP When reading an archive, reblock it as we read it. Normally, \fItar\fP reads each block with a single \fIread(2)\fP system call. This does not work when reading from a pipe or network socket under Berkeley Unix. With this option, it will do multiple \fIread(2)\fPs until it gets enough data to fill the specified block size. \fB\-B\fP can also be used to speed up the reading of tapes that were written with small blocking factors, by specifying a large blocking factor with \fB\-b\fP and having \fItar\fP read many small blocks into memory before it tries to process them. .IP \fB\-c\fP Create an archive from a list of files. .IP \fB\-D\fP With each message that \fItar\fP produces, print the record number within the archive where the message occurred. This option is especially useful when reading damaged archives, since it helps to pinpoint the damaged section. .IP "\fB\-f\fP \fIF\fP" Specify the filename of the archive. If the specified filename is ``\-'', the archive is read from the standard input or written to the standard output. If this option is not used, a default archive name (which was picked when tar was compiled) is used. The default is normally set to the ``first'' tape drive or other transportable I/O medium on the system. .IP \fB\-h\fP When creating an archive, if a symbolic link is encountered, dump the file or directory to which it points, rather than dumping it as a symbolic link. .IP \fB\-i\fP When reading an archive, ignore blocks of zeros in the archive. Normally a block of zeros indicates the end of the archive, but in a damaged archive, or one which was created by appending several archives, this option allows \fItar\fP to continue. It is not on by default because there is garbage written after the zeroed blocks by the Unix \fItar\fP program. .IP \fB\-k\fP When extracting files from an archive, keep existing files, rather than overwriting them with the version from the archive. .IP \fB\-m\fP When extracting files from an archive, set each file's modified timestamp to the current time, rather than extracting each file's modified timestamp from the archive. .IP \fB\-o\fP When creating an archive, write an old format archive, which does not include information about directories, pipes, or device files, and specifies file ownership by uid's and gid's rather than by user names and group names. In most cases, a ``new'' format archive can be read by an ``old'' tar program without serious trouble, so this option should seldom be needed. .IP \fB\-p\fP When extracting files from an archive, restore them to the same permissions that they had in the archive. If \fB\-p\fP is not specified, the current umask limits the permissions of the extracted files. See \fIumask(2)\fP. .IP \fB\-t\fP List a table of contents of an existing archive. If file names are specified, just list files matching the specified names. .IP \fB\-s\fP When specifying a list of filenames to be listed or extracted from an archive, the \fB\-s\fP flag specifies that the list is sorted into the same order as the tape. This allows a large list to be used, even on small machines, because the entire list need not be read into memory at once. Such a sorted list can easily be created by running ``tar \-t'' on the archive and editing its output. .IP "\fB\-T\fP \fIF\fP" Rather than specifying the file names to operate on as arguments to the \fItar\fP command, this option specifies that the file names should be read from the file \fIF\fP, one per line. If the file name specified is ``\-'', the list is read from the standard input. This option, in conjunction with the \fB\-s\fP option, allows an arbitrarily large list of files to be processed, and allows the list to be piped to \fItar\fP. .IP \fB\-v\fP Be verbose about the files that are being processed or listed. Normally, archive creation or file extraction are silent, and archive listing just gives file names. The \fB\-v\fP option causes an ``ls \-l''\-like listing to be produced. .IP \fB\-x\fP Extract files from an existing archive. If file names are specified, just extract files matching the specified names, otherwise extract all the files in the archive. .IP "\fB\-z\fP or \fB\-Z\fP" When extracting or listing an archive, these options specify that the archive should be decompressed while it is read, using the \-d option of the \fIcompress(1)\fP program. The archive itself is not modified. .SH "SEE ALSO" shar(1), tar(5), compress(1), ar(1), arc(1), cpio(1), dump(8), restore(8), restor(8) .SH BUGS The \fBr, u, w, X, l, F, C\fP, and \fIdigit\fP options of Unix \fItar\fP are not supported. .LP It should be possible to create a compressed archive with the \fB\-z\fP option. .LP