1995-01-26 00:14:11 +00:00
|
|
|
.\" Copyright (c) 1991, 1992, 1993 Free Software Foundation -*- nroff -*-
|
|
|
|
.\" See /usr/src/gnu/COPYING for conditions of redistribution
|
|
|
|
.\"
|
|
|
|
.\" Written by John F. Woods <jfw@jfwhome.funhouse.com>
|
1998-01-05 11:32:39 +00:00
|
|
|
.\" Updated by Robert Eckardt <roberte@mep.ruhr-uni-bochum.de>
|
1995-01-26 00:14:11 +00:00
|
|
|
.\"
|
1999-08-27 23:37:10 +00:00
|
|
|
.\" $FreeBSD$
|
1995-01-26 00:14:11 +00:00
|
|
|
.\"
|
2000-12-24 10:19:55 +00:00
|
|
|
.Dd December 23, 2000
|
2001-07-10 10:42:19 +00:00
|
|
|
.Os
|
1995-01-26 00:14:11 +00:00
|
|
|
.Dt TAR 1
|
|
|
|
.Sh NAME
|
|
|
|
.Nm tar
|
2000-12-25 09:08:44 +00:00
|
|
|
.Nd "tape archiver; manipulate ""tar"" archive files"
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm
|
2001-02-01 16:38:02 +00:00
|
|
|
.Op Oo Fl Oc Ns Ar bundled-options Ar Args
|
1998-01-05 11:32:39 +00:00
|
|
|
.Op Ar gnu-style-flags
|
2000-12-25 09:08:44 +00:00
|
|
|
.Op Ar filenames | Fl C Ar directory-name
|
|
|
|
.Ar ...
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh DESCRIPTION
|
1998-01-05 11:32:39 +00:00
|
|
|
.Nm Tar
|
2004-07-02 19:07:33 +00:00
|
|
|
is short for
|
2000-12-25 09:08:44 +00:00
|
|
|
.Dq tape archiver ,
|
1995-01-26 00:14:11 +00:00
|
|
|
so named for historical reasons; the
|
|
|
|
.Nm
|
|
|
|
program creates, adds files to, or extracts files from an archive file
|
|
|
|
in
|
2000-12-25 09:08:44 +00:00
|
|
|
.Nm
|
1995-01-26 00:14:11 +00:00
|
|
|
format, called a
|
|
|
|
.Ar tarfile .
|
2000-12-25 09:08:44 +00:00
|
|
|
A
|
|
|
|
.Ar tarfile
|
|
|
|
is often a magnetic tape, but can be a floppy diskette or any
|
1995-01-26 00:14:11 +00:00
|
|
|
regular disk file.
|
|
|
|
.Pp
|
|
|
|
The first argument word of the
|
|
|
|
.Nm
|
|
|
|
command line is usually a command word of bundled function and modifier
|
1996-02-09 21:14:26 +00:00
|
|
|
letters, optionally preceded by a dash;
|
1995-01-26 00:14:11 +00:00
|
|
|
it must contain exactly one function letter from the set
|
|
|
|
.Cm A ,
|
|
|
|
.Cm c ,
|
|
|
|
.Cm d ,
|
|
|
|
.Cm r ,
|
|
|
|
.Cm t ,
|
|
|
|
.Cm u ,
|
|
|
|
.Cm x ,
|
2000-12-25 09:08:44 +00:00
|
|
|
for
|
|
|
|
.Em append ,
|
|
|
|
.Em create ,
|
|
|
|
.Em difference ,
|
|
|
|
.Em replace ,
|
|
|
|
.Em table of contents ,
|
|
|
|
.Em update ,
|
|
|
|
and
|
|
|
|
.Em extract
|
|
|
|
(further described below).
|
|
|
|
The command word can also contain other function modifiers described below,
|
|
|
|
some of which will take arguments from the command line in the order they
|
|
|
|
are specified in the command word (review the
|
|
|
|
.Sx EXAMPLES
|
|
|
|
section).
|
|
|
|
Functions and function modifiers can also be specified
|
1996-02-09 21:14:26 +00:00
|
|
|
with the GNU argument convention (preceded by two dashes, one function or
|
2000-12-25 09:08:44 +00:00
|
|
|
modifier per word.
|
|
|
|
Command-line arguments that specify files to
|
1995-01-26 00:14:11 +00:00
|
|
|
add to, extract from, or list from an archive may be given as shell
|
|
|
|
pattern matching strings.
|
|
|
|
.Sh FUNCTIONS
|
|
|
|
Exactly one of the following functions must be specified.
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width "--concatenate" -compact
|
|
|
|
.It Fl A
|
|
|
|
.It Fl -catenate
|
|
|
|
.It Fl "-concatenate"
|
2000-12-25 09:08:44 +00:00
|
|
|
Append the contents of named file, which must itself be a
|
|
|
|
.Nm
|
|
|
|
archive,
|
1995-01-26 00:14:11 +00:00
|
|
|
to the end of the archive (erasing the old end-of-archive block).
|
|
|
|
This has the effect of adding the files contained in the named file to
|
|
|
|
the first archive, rather than adding the second archive as an element
|
|
|
|
of the first.
|
2000-12-25 09:08:44 +00:00
|
|
|
.Em Note :
|
|
|
|
This option requires a rewritable
|
|
|
|
.Ar tarfile ,
|
1995-01-26 00:14:11 +00:00
|
|
|
and therefore does not work on quarter-inch cartridge tapes.
|
|
|
|
.It Fl c
|
|
|
|
.It Fl -create
|
|
|
|
Create a new archive (or truncates an old one) and writes the named files
|
|
|
|
to it.
|
|
|
|
.It Fl d
|
|
|
|
.It Fl -diff
|
|
|
|
.It Fl -compare
|
|
|
|
Find differences between files in the archive and corresponding files in
|
|
|
|
the file system.
|
|
|
|
.It Fl -delete
|
2000-12-25 09:08:44 +00:00
|
|
|
Delete named files from the archive.
|
|
|
|
(Does not work on quarter-inch tapes).
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl r
|
|
|
|
.It Fl -append
|
2000-12-25 09:08:44 +00:00
|
|
|
Append files to the end of an archive.
|
|
|
|
(Does not work on quarter-inch tapes).
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl t
|
|
|
|
.It Fl -list
|
2000-12-25 09:08:44 +00:00
|
|
|
List the contents of an archive; if
|
|
|
|
.Ar filename
|
|
|
|
arguments are given, only those
|
1995-01-26 00:14:11 +00:00
|
|
|
files are listed, otherwise the entire table of contents is listed.
|
|
|
|
.It Fl u
|
|
|
|
.It Fl -update
|
|
|
|
Append the named files if the on-disk version has a modification date
|
2000-12-25 09:08:44 +00:00
|
|
|
more recent than their copy in the archive (if any).
|
|
|
|
Does not work on quarter-inch tapes.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl x
|
|
|
|
.It Fl -extract
|
|
|
|
.It Fl -get
|
2000-12-25 09:08:44 +00:00
|
|
|
Extract files from an archive.
|
|
|
|
The owner, modification time, and file permissions are restored, if possible.
|
|
|
|
If no
|
1995-01-26 00:14:11 +00:00
|
|
|
.Ar file
|
2000-12-25 09:08:44 +00:00
|
|
|
arguments are given, extract all the files in the archive.
|
|
|
|
If a
|
1995-01-26 00:14:11 +00:00
|
|
|
.Ar filename
|
|
|
|
argument matches the name of a directory on the tape, that directory and
|
|
|
|
its contents are extracted (as well as all directories under that directory).
|
|
|
|
If the archive contains multiple entries corresponding to the same file
|
|
|
|
(see the
|
|
|
|
.Fl -append
|
|
|
|
command above), the last one extracted will overwrite all earlier versions.
|
|
|
|
.El
|
|
|
|
.Sh OPTIONS
|
|
|
|
The other options to
|
|
|
|
.Nm
|
|
|
|
may be combined arbitrarily; single-letter options may be bundled in with
|
2000-12-25 09:08:44 +00:00
|
|
|
the command word.
|
|
|
|
Verbose options which take arguments will be
|
1995-01-26 00:14:11 +00:00
|
|
|
followed by the argument; single-letter options will consume
|
|
|
|
successive command line arguments (see the
|
|
|
|
.Sx EXAMPLES
|
|
|
|
below).
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width "--preserve-permissions" -compact
|
|
|
|
.It Fl -help
|
|
|
|
Prints a message listing and briefly describing all the command
|
1998-01-05 11:32:39 +00:00
|
|
|
options to
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm .
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl -atime-preserve
|
|
|
|
Restore the access times on files which are written to tape (note that
|
|
|
|
this will change the inode-change time!).
|
|
|
|
.It Fl b
|
|
|
|
.It Fl -block-size Ar number
|
1998-01-05 11:32:39 +00:00
|
|
|
Sets the block size for reading or writing to
|
|
|
|
.Ar number
|
|
|
|
* 512-byte blocks.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl B
|
|
|
|
.It Fl -read-full-blocks
|
2000-12-25 09:08:44 +00:00
|
|
|
Re-assemble short reads into full blocks (for reading
|
|
|
|
.Bx 4.2
|
|
|
|
pipes).
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl C Ar directory
|
|
|
|
.It Fl -directory Ar directory
|
|
|
|
Change to
|
|
|
|
.Ar directory
|
1998-07-09 04:28:19 +00:00
|
|
|
before processing the remaining arguments.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl -checkpoint
|
1998-01-05 11:32:39 +00:00
|
|
|
Print number of buffer reads/writes while reading/writing the archive.
|
2000-12-25 09:08:44 +00:00
|
|
|
.It Fl f Xo
|
|
|
|
.Oo Ar hostname : Oc Ns Ar file
|
|
|
|
.Xc
|
|
|
|
.It Fl -file Xo
|
|
|
|
.Oo Ar hostname : Oc Ns Ar file
|
|
|
|
.Xc
|
1995-01-26 00:14:11 +00:00
|
|
|
Read or write the specified
|
|
|
|
.Ar file
|
2000-12-25 09:08:44 +00:00
|
|
|
(default is
|
2001-01-01 19:50:48 +00:00
|
|
|
.Pa /dev/sa0 ) .
|
2000-12-25 09:08:44 +00:00
|
|
|
If a
|
1995-01-26 00:14:11 +00:00
|
|
|
.Ar hostname
|
|
|
|
is specified,
|
|
|
|
.Nm
|
|
|
|
will use
|
|
|
|
.Xr rmt 8
|
|
|
|
to read or write the specified
|
|
|
|
.Ar file
|
2000-12-25 09:08:44 +00:00
|
|
|
on a remote machine.
|
|
|
|
.Dq Ar -
|
|
|
|
may be used as a filename, for reading
|
1996-08-13 00:13:49 +00:00
|
|
|
or writing to/from stdin/stdout.
|
1998-01-05 11:32:39 +00:00
|
|
|
.It Fl -force-local
|
2000-12-25 09:08:44 +00:00
|
|
|
Archive file is local even if it has a colon.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl F Ar file
|
|
|
|
.It Fl -info-script Ar file
|
|
|
|
.It Fl -new-volume-script Ar file
|
|
|
|
Run a script at the end of each archive volume (implies
|
|
|
|
.Fl M ) .
|
1995-04-10 11:47:37 +00:00
|
|
|
.It Fl -fast-read
|
|
|
|
Stop after all non-wildcard extraction targets have been found
|
|
|
|
in the archive.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl G
|
|
|
|
.It Fl -incremental
|
|
|
|
Create/list/extract old GNU-format incremental backup.
|
|
|
|
.It Fl g Ar file
|
|
|
|
.It Fl -listed-incremental Ar file
|
|
|
|
Create/list/extract new GNU-format incremental backup.
|
|
|
|
.It Fl h
|
1996-08-13 00:13:49 +00:00
|
|
|
.It Fl -dereference
|
1995-01-26 00:14:11 +00:00
|
|
|
Don't write symlinks as symlinks; write the data of the files they name.
|
|
|
|
.It Fl i
|
|
|
|
.It Fl -ignore-zeros
|
|
|
|
Ignore blocks of zeroes in archive (usually means End-Of-File).
|
|
|
|
.It Fl -ignore-failed-read
|
|
|
|
Don't exit with non-zero status on unreadable files.
|
2000-12-24 10:19:55 +00:00
|
|
|
.It Fl j
|
|
|
|
.It Fl y
|
|
|
|
.It Fl -bzip
|
|
|
|
.It Fl -bzip2
|
|
|
|
.It Fl -bunzip2
|
|
|
|
Filter the archive through
|
|
|
|
.Xr bzip2 1 .
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl k
|
1995-10-25 02:17:44 +00:00
|
|
|
.It Fl -keep-old-files
|
1995-01-26 00:14:11 +00:00
|
|
|
Keep files which already exist on disk; don't overwrite them from the archive.
|
|
|
|
.It Fl K Ar file
|
|
|
|
.It Fl -starting-file Ar file
|
|
|
|
Begin at
|
|
|
|
.Ar file
|
|
|
|
in the archive.
|
|
|
|
.It Fl l
|
|
|
|
.It Fl -one-file-system
|
2002-12-12 17:26:04 +00:00
|
|
|
Stay in local file system when creating an archive (do not cross mount
|
1995-01-26 00:14:11 +00:00
|
|
|
points).
|
|
|
|
.It Fl L Ar number
|
|
|
|
.It Fl -tape-length Ar number
|
2004-07-02 19:07:33 +00:00
|
|
|
Change tapes after writing
|
1998-01-05 11:32:39 +00:00
|
|
|
.Ar number
|
|
|
|
* 1024 bytes.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl m
|
|
|
|
.It Fl -modification-time
|
|
|
|
Don't extract file modified time.
|
|
|
|
.It Fl M
|
|
|
|
.It Fl -multi-volume
|
|
|
|
Create/list/extract multi-volume archive.
|
1997-12-30 10:23:09 +00:00
|
|
|
.It Fl n
|
|
|
|
.It Fl -norecurse
|
|
|
|
Don't recurse into subdirectories when creating.
|
1998-01-05 11:32:39 +00:00
|
|
|
.It Fl -volno-file Ar file
|
|
|
|
File name with volume number to start with.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl N Ar date
|
|
|
|
.It Fl -after-date Ar date
|
|
|
|
.It Fl -newer Ar date
|
1998-01-05 11:32:39 +00:00
|
|
|
Only store files with creation time newer than
|
|
|
|
.Ar date .
|
|
|
|
.It Fl -newer-mtime Ar date
|
1998-06-04 21:06:07 +00:00
|
|
|
Only store files with modification time newer than
|
1995-01-26 00:14:11 +00:00
|
|
|
.Ar date .
|
|
|
|
.It Fl o
|
|
|
|
.It Fl -old-archive
|
|
|
|
.It Fl -portability
|
|
|
|
Write a V7 format archive, rather than POSIX format.
|
|
|
|
.It Fl O
|
|
|
|
.It Fl -to-stdout
|
|
|
|
Extract files to standard output.
|
|
|
|
.It Fl p
|
|
|
|
.It Fl -same-permissions
|
|
|
|
.It Fl -preserve-permissions
|
|
|
|
Extract all protection information.
|
|
|
|
.It Fl -preserve
|
|
|
|
Has the effect of
|
2000-12-25 09:08:44 +00:00
|
|
|
.Fl p s .
|
1995-10-25 02:17:44 +00:00
|
|
|
.It Fl P
|
|
|
|
.It Fl -absolute-paths
|
2000-12-25 09:08:44 +00:00
|
|
|
Don't strip leading
|
|
|
|
.Ql /
|
|
|
|
from file names.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl R
|
|
|
|
.It Fl -record-number
|
|
|
|
Show record number within archive with each message.
|
|
|
|
.It Fl -remove-files
|
|
|
|
Remove files after adding them to the archive.
|
|
|
|
.It Fl s
|
|
|
|
.It Fl -same-order
|
|
|
|
.It Fl -preserve-order
|
|
|
|
List of names to extract is sorted to match archive.
|
1998-01-05 11:32:39 +00:00
|
|
|
.It Fl -show-omitted-dirs
|
|
|
|
Show directories which were omitted while processing the archive.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl S
|
|
|
|
.It Fl -sparse
|
2000-12-25 09:08:44 +00:00
|
|
|
Handle
|
|
|
|
.Dq sparse
|
|
|
|
files efficiently.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl T Ar file
|
2000-12-24 10:19:55 +00:00
|
|
|
.It Fl I Ar file
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl -files-from Ar file
|
|
|
|
Get names of files to extract or create from
|
|
|
|
.Ar file ,
|
|
|
|
one per line.
|
|
|
|
.It Fl -null
|
|
|
|
Modifies behavior of
|
|
|
|
.Fl T
|
|
|
|
to expect null-terminated names; disables
|
2000-12-25 09:08:44 +00:00
|
|
|
.Fl C .
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl -totals
|
1998-01-05 11:32:39 +00:00
|
|
|
Prints total bytes written with
|
2000-12-25 09:08:44 +00:00
|
|
|
.Fl -create .
|
2000-12-24 10:52:23 +00:00
|
|
|
.It Fl U
|
|
|
|
.It Fl -unlink
|
|
|
|
.It Fl -unlink-first
|
|
|
|
Unlink files before creating them.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl v
|
|
|
|
.It Fl -verbose
|
1998-01-05 11:32:39 +00:00
|
|
|
Lists files written to archive with
|
|
|
|
.Fl -create
|
|
|
|
or extracted with
|
2001-02-01 16:38:02 +00:00
|
|
|
.Fl -extract ;
|
1998-01-05 11:32:39 +00:00
|
|
|
lists file protection information along with file names with
|
2000-12-25 09:08:44 +00:00
|
|
|
.Fl -list .
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl V Ar volume-name
|
|
|
|
.It Fl -label Ar volume-name
|
|
|
|
Create archive with the given
|
|
|
|
.Ar volume-name .
|
|
|
|
.It Fl -version
|
1998-01-05 11:32:39 +00:00
|
|
|
Print
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm
|
1998-01-05 11:32:39 +00:00
|
|
|
program version number.
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl w
|
|
|
|
.It Fl -interactive
|
|
|
|
.It Fl -confirmation
|
|
|
|
Ask for confirmation for every action.
|
|
|
|
.It Fl W
|
|
|
|
.It Fl -verify
|
|
|
|
Attempt to verify the archive after writing it.
|
|
|
|
.It Fl -exclude Ar pattern
|
|
|
|
Exclude files matching the
|
|
|
|
.Ar pattern
|
|
|
|
(don't extract them, don't add them, don't list them).
|
|
|
|
.It Fl X Ar file
|
|
|
|
.It Fl -exclude-from Ar file
|
|
|
|
Exclude files listed in
|
|
|
|
.Ar file .
|
|
|
|
.It Fl Z
|
|
|
|
.It Fl -compress
|
|
|
|
.It Fl -uncompress
|
|
|
|
Filter the archive through
|
|
|
|
.Xr compress 1 .
|
|
|
|
.It Fl z
|
|
|
|
.It Fl -gzip
|
|
|
|
.It Fl -gunzip
|
|
|
|
Filter the archive through
|
|
|
|
.Xr gzip 1 .
|
|
|
|
.It Fl -use-compress-program Ar program
|
|
|
|
Filter the archive through
|
|
|
|
.Ar program
|
|
|
|
(which must accept
|
|
|
|
.Fl d
|
2000-12-25 09:08:44 +00:00
|
|
|
to mean
|
|
|
|
.Dq decompress ) .
|
1995-01-26 00:14:11 +00:00
|
|
|
.It Fl -block-compress
|
|
|
|
Block the output of compression program for tapes or floppies
|
|
|
|
(otherwise writes will be of odd length, which device drivers may reject).
|
2000-12-25 09:08:44 +00:00
|
|
|
.It Fl Xo
|
|
|
|
.Op Cm 0 Ns - Ns Cm 7 Ns
|
|
|
|
.Op Cm lmh
|
|
|
|
.Xc
|
1995-01-26 00:14:11 +00:00
|
|
|
Specify tape drive and density.
|
|
|
|
.El
|
2000-12-24 10:52:23 +00:00
|
|
|
.Sh ENVIRONMENT
|
|
|
|
The environment variable
|
|
|
|
.Ev TAR_OPTIONS
|
|
|
|
can hold a set of default options for
|
|
|
|
.Nm .
|
|
|
|
These options are interpreted first and can be overwritten by explicit command
|
|
|
|
line parameters.
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh EXAMPLES
|
2000-12-25 09:08:44 +00:00
|
|
|
To create an archive on tape drive
|
2001-01-01 19:50:48 +00:00
|
|
|
.Pa /dev/sa0
|
2000-12-25 09:08:44 +00:00
|
|
|
with a block size of 20 blocks, containing files named
|
|
|
|
.Pa bert
|
|
|
|
and
|
|
|
|
.Pa ernie ,
|
|
|
|
you can enter
|
2001-01-01 19:50:48 +00:00
|
|
|
.Dl "tar cfb /dev/sa0 20 bert ernie"
|
1995-01-26 00:14:11 +00:00
|
|
|
or
|
2001-01-01 19:50:48 +00:00
|
|
|
.Dl "tar --create --file /dev/sa0 --block-size 20 bert ernie"
|
1995-01-26 00:14:11 +00:00
|
|
|
Note that the
|
|
|
|
.Fl f
|
|
|
|
and
|
|
|
|
.Fl b
|
|
|
|
flags both require arguments, which they take from the command line in
|
|
|
|
the order they were listed in the command word.
|
|
|
|
.Pp
|
2000-12-25 09:08:44 +00:00
|
|
|
Because
|
2001-01-01 19:50:48 +00:00
|
|
|
.Pa /dev/sa0
|
2000-12-25 09:08:44 +00:00
|
|
|
is the default device, and 20 is the default block
|
1995-01-26 00:14:11 +00:00
|
|
|
size, the above example could have simply been
|
2000-12-25 09:08:44 +00:00
|
|
|
.Dl "tar c bert ernie"
|
1995-01-26 00:14:11 +00:00
|
|
|
.Pp
|
|
|
|
To extract all the C sources and headers from an archive named
|
2000-12-25 09:08:44 +00:00
|
|
|
.Pa backup.tar ,
|
|
|
|
type
|
|
|
|
.Dl "tar xf backup.tar '*.[ch]'"
|
1995-01-26 00:14:11 +00:00
|
|
|
Note that the pattern must be quoted to prevent the shell from
|
|
|
|
attempting to expand it according the files in the current working
|
|
|
|
directory (the shell does not have access to the list of files in
|
|
|
|
the archive, of course).
|
|
|
|
.Pp
|
1996-08-13 00:13:49 +00:00
|
|
|
To move file hierarchies, use a command line like this:
|
|
|
|
.Bd -literal
|
1997-06-05 23:12:13 +00:00
|
|
|
tar -cf - -C srcdir . | tar xpf - -C destdir
|
1996-08-13 00:13:49 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2000-12-25 09:08:44 +00:00
|
|
|
To create a compressed archive on diskette, using
|
|
|
|
.Xr gzip 1 ,
|
|
|
|
use a command-line like
|
|
|
|
.Dl "tar --block-compress -z -c -v -f /dev/fd1a -b 36 tar/"
|
1998-01-05 11:32:39 +00:00
|
|
|
.Pp
|
2000-12-25 09:08:44 +00:00
|
|
|
Note that you cannot mix bundled flags and
|
|
|
|
.Fl -style
|
|
|
|
flags; you can use
|
1995-01-26 00:14:11 +00:00
|
|
|
single-letter flags in the manner above, rather than having to type
|
2000-12-25 09:08:44 +00:00
|
|
|
.Dl "tar --block-compress --gzip --verbose --file /dev/fd1a --block-size 20 tar/"
|
1995-01-26 00:14:11 +00:00
|
|
|
.Pp
|
|
|
|
The above-created diskette can be listed with
|
2000-12-25 09:08:44 +00:00
|
|
|
.Dl "tar tvfbz /dev/fd1a 36"
|
1995-01-26 00:14:11 +00:00
|
|
|
.Pp
|
2000-12-25 09:08:44 +00:00
|
|
|
To join two
|
|
|
|
.Nm
|
|
|
|
archives into a single archive, use
|
|
|
|
.Dl "tar Af archive1.tar archive2.tar"
|
|
|
|
which will add the files contained in
|
|
|
|
.Pa archive2.tar
|
|
|
|
onto the end of
|
|
|
|
.Pa archive1.tar
|
|
|
|
(note that this can't be done by simply typing
|
|
|
|
.Dl "cat archive2.tar >> archive1.tar"
|
|
|
|
because of the end-of-file block at the end of a
|
|
|
|
.Nm
|
|
|
|
archive).
|
1998-01-05 11:32:39 +00:00
|
|
|
.Pp
|
2000-12-25 09:08:44 +00:00
|
|
|
To archive all files from the directory
|
|
|
|
.Pa srcdir ,
|
|
|
|
which were modified
|
2004-07-02 21:53:39 +00:00
|
|
|
after Feb.\& 9th 1997, 13:00 h, use
|
2000-12-25 09:08:44 +00:00
|
|
|
.Dl "tar -c -f backup.tar --newer-mtime 'Feb 9 13:15 1997' srcdir/"
|
1998-01-05 11:32:39 +00:00
|
|
|
.Pp
|
2000-12-25 09:08:44 +00:00
|
|
|
Other possible time specifications are
|
|
|
|
.Sq "02/09/97 13:15" ,
|
|
|
|
.Sq "1997-02-09 13:15" ,
|
|
|
|
.Sq "13:15 9 Feb 1997" ,
|
2004-07-02 19:07:33 +00:00
|
|
|
.Sq "9 Feb 1997 13:15" ,
|
2000-12-25 09:08:44 +00:00
|
|
|
.Sq "Feb. 9, 1997 1:15pm" ,
|
|
|
|
.Sq "09-Feb" ,
|
|
|
|
.Sq "3 weeks ago"
|
|
|
|
or
|
|
|
|
.Sq "May first Sunday" .
|
|
|
|
To specify the correct time zone use either e.g.\&
|
|
|
|
.Sq "13:15 CEST"
|
|
|
|
or
|
|
|
|
.Sq "13:15+200" .
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh ENVIRONMENT
|
1998-01-05 11:32:39 +00:00
|
|
|
The
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm
|
1998-01-05 11:32:39 +00:00
|
|
|
program examines the following environment variables.
|
1998-09-22 09:55:09 +00:00
|
|
|
.Bl -tag -width "POSIXLY_CORRECT"
|
2000-12-25 09:08:44 +00:00
|
|
|
.It Ev POSIXLY_CORRECT
|
1998-01-05 11:32:39 +00:00
|
|
|
Normally,
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm
|
1998-01-05 11:32:39 +00:00
|
|
|
will process flag arguments that appear in the file list.
|
|
|
|
If set in the environment, this causes
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm
|
1998-01-05 11:32:39 +00:00
|
|
|
to consider the first
|
1995-01-26 00:14:11 +00:00
|
|
|
non-flag argument to terminate flag processing, as per the POSIX specification.
|
2000-12-25 09:08:44 +00:00
|
|
|
.It Ev SHELL
|
1995-01-26 00:14:11 +00:00
|
|
|
In interactive mode, a permissible response to the prompt is to
|
2000-12-25 09:08:44 +00:00
|
|
|
request to spawn a subshell, which will be
|
|
|
|
.Pa /bin/sh
|
|
|
|
unless the
|
|
|
|
.Ev SHELL
|
|
|
|
variable is set.
|
|
|
|
.It Ev TAPE
|
|
|
|
Changes
|
|
|
|
.Nm Ns 's
|
|
|
|
default tape drive (which is still overridden by the
|
1995-01-26 00:14:11 +00:00
|
|
|
.Fl f
|
|
|
|
flag).
|
2001-02-18 17:30:29 +00:00
|
|
|
.It TAR_RSH
|
|
|
|
The TAR_RSH environment variable allows you to override the default
|
|
|
|
shell used as the transport for
|
2001-03-05 15:14:19 +00:00
|
|
|
.Nm .
|
1995-01-26 00:14:11 +00:00
|
|
|
.El
|
|
|
|
.Sh FILES
|
2001-01-01 19:50:48 +00:00
|
|
|
.Bl -tag -width "/dev/sa0"
|
|
|
|
.It Pa /dev/sa0
|
1995-01-26 00:14:11 +00:00
|
|
|
The default tape drive.
|
|
|
|
.El
|
2000-12-24 10:19:55 +00:00
|
|
|
.Sh COMPATIBILITY
|
|
|
|
The
|
|
|
|
.Fl y
|
2000-12-25 09:08:44 +00:00
|
|
|
is a
|
|
|
|
.Fx
|
|
|
|
localism.
|
|
|
|
The GNU
|
|
|
|
.Nm
|
2002-10-01 23:15:32 +00:00
|
|
|
maintainer has now chosen
|
2000-12-24 10:19:55 +00:00
|
|
|
.Fl j
|
2000-12-25 09:08:44 +00:00
|
|
|
as the offical
|
|
|
|
.Xr bzip2 1
|
|
|
|
compression option in GNU
|
|
|
|
.Nm
|
|
|
|
1.13.18 and later.
|
2000-12-24 10:19:55 +00:00
|
|
|
The
|
|
|
|
.Fl I
|
2000-12-25 09:08:44 +00:00
|
|
|
option is for compatibility with Solaris's
|
|
|
|
.Nm .
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh SEE ALSO
|
1999-03-29 11:25:45 +00:00
|
|
|
.Xr bzip2 1 ,
|
1995-01-26 00:14:11 +00:00
|
|
|
.Xr compress 1 ,
|
|
|
|
.Xr gzip 1 ,
|
|
|
|
.Xr pax 1 ,
|
|
|
|
.Xr rmt 8
|
|
|
|
.Sh HISTORY
|
2000-12-25 09:08:44 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
format has a rich history, dating back to Sixth Edition
|
|
|
|
.Ux .
|
1998-01-05 11:32:39 +00:00
|
|
|
The current implementation of
|
2000-11-20 12:18:54 +00:00
|
|
|
.Nm
|
1998-01-05 11:32:39 +00:00
|
|
|
is the GNU implementation, which
|
2000-12-25 09:08:44 +00:00
|
|
|
originated as the public-domain
|
|
|
|
.Nm
|
|
|
|
written by
|
|
|
|
.An John Gilmore .
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh AUTHORS
|
2000-11-22 09:23:54 +00:00
|
|
|
.An -nosplit
|
2000-12-25 09:08:44 +00:00
|
|
|
A cast of thousands, including [as listed in the
|
|
|
|
.Pa ChangeLog
|
|
|
|
file in the source]
|
1998-04-01 06:26:40 +00:00
|
|
|
.An John Gilmore
|
|
|
|
(author of original public domain version),
|
|
|
|
.An Jay Fenlason
|
|
|
|
(first GNU author),
|
|
|
|
.An Joy Kendall ,
|
|
|
|
.An Jim Kingdon ,
|
|
|
|
.An David J. MacKenzie ,
|
|
|
|
.An Michael I Bushnell ,
|
|
|
|
.An Noah Friedman ,
|
|
|
|
and innumerable others who have contributed fixes and additions.
|
|
|
|
.Pp
|
|
|
|
Man page obtained by the
|
2000-11-14 11:20:58 +00:00
|
|
|
.Fx
|
2000-11-22 09:23:54 +00:00
|
|
|
group from the
|
|
|
|
.Nx 1.0
|
|
|
|
release.
|
1995-01-26 00:14:11 +00:00
|
|
|
.Sh BUGS
|
|
|
|
The
|
|
|
|
.Fl C
|
2000-12-25 09:08:44 +00:00
|
|
|
feature does not work like historical
|
|
|
|
.Nm
|
|
|
|
programs, and is probably untrustworthy.
|
1995-01-26 00:14:11 +00:00
|
|
|
.Pp
|
2004-07-02 19:07:33 +00:00
|
|
|
The
|
|
|
|
.Fl A
|
2000-12-25 09:08:44 +00:00
|
|
|
command should work to join an arbitrary number of
|
|
|
|
.Nm
|
|
|
|
archives
|
1995-01-26 00:14:11 +00:00
|
|
|
together, but it does not; attempting to do so leaves the
|
|
|
|
end-of-archive blocks in place for the second and subsequent archives.
|
2001-03-28 19:31:59 +00:00
|
|
|
.Pp
|
2001-04-04 09:49:05 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
file format is a semi fixed width field format, and the field
|
2001-03-28 19:31:59 +00:00
|
|
|
for device numbers were designed for 16 bit (8 major, 8 minor)
|
2002-08-13 14:10:36 +00:00
|
|
|
and cannot absorb our 32 bit (8 major, 16+8 minor) numbers.
|