tar

NAME

tar - create archive files

SYNOPSIS

tar c [befHLlmoPpqvwX] [B bytes] [file ...]

tar r [befHLlmoPpqvwX] [B bytes] [file ...]
tar x [befHLlmopvwX] [file ...]
tar t [befHLlmopvwX] [file ...]
tar u [befHLlmopqvwX] [B bytes] [file ...]

DESCRIPTION

Interix provides the pax(1) utility to read and write tar(1)-format files. The pax(1) utility can read and write files in both the POSIX.2 standard format (USTAR) and the old Berkeley Software Distribution (BSD) 4.3 format. If pax(1) is invoked as tar(1), it behaves like tar(1). For the sake of convenience, the tar(1) options are presented in this topic. For more information on the archive format and the behavior of the utility, see the pax(1) reference page.

The tar(1) command takes as arguments a function letter followed by zero or more modifying letters. Each function is given its own synopsis above; the functions are as follows:

c
Create the new archive; writes specified files starting at the beginning of the archive instead of appending after the end.
r
Write the specified file or files to the end of the archive.
t
Write the archive's Table of Contents to standard output.
u
Update the archive by adding file or files if they are not already present or if they have been modified since they were added to the archive.
x
Extract the named file or files from the archive. If file is a directory, its contents are extracted recursively.

These functions can be modified by the following letters. Not all functions accept all modifiers.

b
Use the first file (or the second, if f has already been specified) as the blocking factor for tape records. Only use this modifier with raw magnetic tape archives.
B bytes
Limit the number of bytes written to a single archive volume to bytes. The bytes limit can end with m, k, or b to specify multiplication by 1048576 (1M), 1024 (1K) or 512, respectively. A pair of bytes limits can be separated by x to indicate a product.

Important

e
Stop at the first error.
f
Use the first file operand (or the second if b has already been specified) as the name of the archive. If file is , read from standard input or write to standard output, whichever is appropriate.
H
Follow command-line symbolic links only.
l
Report if links to the files being archived cannot be resolved.
L
Follow symbolic links.
m
Do not restore the file modification times; instead, mark each file with the time of extraction.
o
Give the extracted files the user and group identifiers of the user running tar(1), rather than trying to preserve the original values.
p
Preserve user identifier (ID), group ID, file mode, access and modification times.
P
Do not follow symbolic links. This is the default.
q
Suppress the error message indicating that not all Windows permissions for a file were preserved in the archive.
v
Be verbose; write the operation and the name of each file processed to standard error. For the functions c, r, and u, tar(1) writes "a" as the operation; for the function x, tar(1) writes "x".
w
Wait for confirmation before each action.
X
Do not pass over mount points in the file system. This option has no effect on Interix.

DIAGNOSTICS

If a file has Windows-specific permissions in the discretionary access control (DACL) list that are not mapped to UNIX permissions, tar displays the following error message:

pax: warning: filename has additional permissions not preserved in archive.

This indicates that these Windows permissions could not be preserved in the archive.

ENVIRONMENT VARIABLES

The tar(1) utility uses of the following environment variable, if defined:

TAPE
Contains the default archive name; used if the -f option is not specified.

NOTES

Sometimes when creating or writing to an archive, the following message is printed to standard error:

uid nnnnnnn too large to fit in header: substituting 32666

On traditional systems, the user ID and group ID numbers fit into 16 bits, but on Interix, they can be 32 bits long. The Interix user identifiers (UIDs) and group identifiers (GIDS) do not fit into the tar or ustar archive formats. This implementation substitutes the value 32666 (decimal) for the original UID or GID.

As a consequence, you can get errors when unpacking tar archives you created because they do not contain your UID. The solution is to use ustar format. Substitution is not a problem with the ustar format. That format records both the numeric and character string representations of these numbers, and the string representation takes precedence over the numeric.

SEE ALSO

pax(1)